vrijdag 14 september 2012

ADF BC Logging

Challenge

You want to be able to see all the sql-statements and DML-statements that your ADF application is executing.

Context

JDeveloper & ADF : 11.1.1.5.0
OS: Windows 7

Solution

The most blogged solution is the one where you put on the jbo logging on the level of the jvm.
In this case you just add the following java option to the run configuration : -Djbo.debugoutput=console
While this will give you everything you need, you get a lot of clutter and it is difficult to see the information you are looking for.

Another solution would be to implement some java code in your base classes to show the necessary information.  See the following blog for more information on it.
while this will give you only the information you really need, the code is depending on the de ADF BC framework directly and is not supported to work over different versions.

The solution I came across today, thanks to some forum discussions, is the use of the ADF Logger.
While you just run your application, no special run configuration or debug setting is needed, you can change the log level of the different ADF components.  The change is immediate active, no rerun or stopping of the jvm is needed.
The trick is to find just the one you need.
In case you want to see the SQL and DML statements you need to set the oracle.jbo.common.ADFLoggerDiagnosticImpl to FINEST, anything lower will not show the statements.

How to set this logger level?

Follow this procedure to use the logger level:
  1. Just run or debug your application.
  2. In the Log-pane you should see your application starting up.
  3. In this pane, there is an Action-menu.  Choose here the "Oracle Diagnostic Logging"-option.



  4. This will open a new tab, called "logging.xml".
  5. Now walk through the tree until you find the oralce.jbo.common.ADFLoggerDiagnosticImpl
  6. And then select in the Level column "Finest" or type "TRACE:32"
  7. This change is active immediately
  8. You should see appearing the SQL-statements in the Log pane when you are walking through your application.
While it still generates a lot of clutter, the advantage to activate it at the moment you need it, is really a big step forward.

When you stop and restart the JVM/WLS, just close this "logging.xml"-tab and restart the procedure as mentioned above.

 A nice enhancement feature would be to have an option to only see the SQL- and DML-statements.

Geen opmerkingen:

Een reactie plaatsen