Adventures in ADF Logging - Part 5

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!


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

Posted by JW on June 13, 2011 at 07:41 AM BST #

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.

Posted by Duncan on June 13, 2011 at 09:04 AM BST #

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

Posted by Jobinesh on June 16, 2011 at 06:52 PM BST #

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?


Posted by Aino Andriessen on June 22, 2011 at 08:43 AM BST #

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.

Posted by Marina on September 26, 2011 at 03:21 PM BST #

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

Posted by Duncan on September 28, 2011 at 10:32 AM BST #

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


Posted by guest on October 18, 2011 at 03:39 PM BST #

Post a Comment:
Comments are closed for this entry.

Hawaii, Yes! Duncan has been around Oracle technology way too long but occasionally has interesting things to say. He works in the Development Tools Division at Oracle, but you guessed that right? In his spare time he contributes to the Hudson CI Server Project at Eclipse
Follow DuncanMills on Twitter

Note that comments on this blog are moderated so (1) There may be a delay before it gets published (2) I reserve the right to ignore silly questions and comment spam is not tolerated - it gets deleted so don't even bother, we all have better things to do with our lives.
However, don't be put off, I want to hear what you have to say!


« July 2016