X

Technical Articles relating to Oracle Development Tools and Frameworks

  • ADF
    June 11, 2011

Adventures in ADF Logging - Part 5

Duncan Mills
Architect

Unleashing the True Power of the ADFLogger

So far we've seen that the logging facility  provided by the ADFLogger and the attendant tools in JDeveloper is all pretty useful and provides a powerful way of implementing and examining your logs. However, lets's take it to the next level (here's where it gets really interesting). 

You are, I'm sure, familiar with the -Djbo.debugoutput=console switch which is a command line argument to WebLogic or the ADF/BC tester which provides a bunch of useful trace information such as when bindings are constructed and ADF/BC queries and bind variables are manipulated.  It's generally regarded as a key tool in any ADF Hackers toolbox.  However, you may have thought to yourself: This is great but it's a pain having to re-run the application (and restart WLS) just to switch this diagnostic on... And you'd be right, it is a pain and certainly not something you would entertain on a production system. But guess what, we can use the logging capabilities to do the same thing without a restart.

Debugoutput Without the Pain

 To work this magic, just run your application without the -Djbo.debugoutput flag and once it's running bring up the ODL Configuration Screen (Refer back to Part 3 in this series if you've not already read up on how to do that).

Now switch on FINEST for the following packages:

 

  • oracle.adf
  • oracle.adfinternal
  • oracle.jbo 

 

Here's what it should look like:

Switching on Logging for ADF

Now go back to the web browser and carry out the activity that you're trying to trace (remember - no need to restart, the logging kicks in immediately). Once you're done open up the ODL Analyzer (refer to Part 4 in this series). The main thing that you'll observe is an awful lot of logging has happened. In this case I happen to have added my own logging call into an Entity Object accessor method so I can search the log for the call that is part of the transaction I'm interested in:

Search for an interesting record

Now I can use that Related By Request option that we looked at last time to see all the log messages associated with this one:

Filter By Request

Which leads to this more constrained list: 

Filtered List of results

Now scroll down this list of messages and I'll start to encounter useful messages such as this set:

Interesting ADF Actions

In this case it's the SQL that is being generated to get the rowcount on a VO and I can look at the key information such as the actual count returned, the SQL and the bind variable substitution.

But Wait, There's More

The final piece in the jigsaw  is that mysterious Related By ADF Request option that I skipped over last time. Now that we have a full-fat diagnostic log let's use that option instead of plain Related by Request. When you do this you're taken to that By ADF Request tab in the analyzer. This is what you'll see:

ADF Request View

What you're seeing here is a complete breakdown of the ADF Request by phase with elapsed times and a really simple to understand view of what happened when, and how log it took. You can view the details of each message in the bottom pane, and in this case again we're looking at an Estimated Row Count call.

At this point I should probably shut up and let you drool. Enjoy!

Join the discussion

Comments ( 7 )
  • JW Monday, June 13, 2011

    Is this inferring that JDeveloper should be installed in a production environment? to make use of this tool?


  • Duncan Monday, June 13, 2011

    No I don't think I'm saying that. I am saying that it can be used to analyse any of these ODL logs. It's going to be pretty unusual to have to turn this level of logging on in a production environment, unless of course you have a big hole in your testing.


  • Jobinesh Thursday, June 16, 2011

    Great posts on Loggings. Thanks for sharing this. A web interface for the log analyzer(same as ODL Analyzer) looks like a promising ER for EM/some admin app? Thanks


  • Aino Andriessen Wednesday, June 22, 2011

    Hi Duncan,

    Great series, really useful.

    However, can you elaborate on how to configure ADFLogging when running the Business Component tester or from JUnit tests (and not having WLS and ODL). Is there another way than the standard java.util.logging configuration?

    Ciao

    Aino


  • Marina Monday, September 26, 2011

    Thanks a lot for the information about ODL.

    I'd like to know where I can find information about the configuration (properties) of handlers. I need to specify a daily rotation, and some patterns in the messagges. Thanks.


  • Duncan Wednesday, September 28, 2011

    ODL information can be found in the Fusion Middleware Administrators Guide - chapter 12:

    http://download.oracle.com/docs/cd/E21764_01/core.1111/e10105/logs.htm#ASADM217


  • guest Tuesday, October 18, 2011

    is there anyway to log the messages to database , if not is there chance of getting that in future release, what you have is very good for development time, but not for production.

    what we are looking for is some thing similar to JDBCAppender in log4j or logback . we have multiple servers in cluster , when user reports a problem in production we have to manually search log files in each server to find out which server they were on . if all goes to database , it would be lot easier to find

    Regards


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.