Oracle ADF Logger - Part 1
An Overview of ADF Logger:
ADF Logger is a debugging mechanism that will help diagnose various errors in an ADF Application.
It consists of various debugging tools written around the API ADFLogger to be used in both JDeveloper and the WebLogic Enterprise Manager.
ADFLogger is a wrapper utility developed on top of java.util.Logging with added convenience methods.
You can still use other logging mechanisms such as Log4J, Commons Logging, SLF4J, etc. However, ADFLogger has been seamlessly embedded into ADF Framework so that you do not need to reinvent the wheel.
ADF Logger along with Oracle Diagnostic Log Analyzer will not only provide you logging mechanism for your custom code but also give you the flexibility to go trace through all the JSF Page Lifecycle and BC4J events.
How to configure JDeveloper to use ADFLogger:
In order to use ADFLogger, ‘logging.xml’ file needs to be modified to create loggers and logger handlers. However, JDeveloper provides a nice UI to do that.
On JDeveloper 12c, go to Windows à Log to open up IntegratedWebLogicServer log.
In the IntegratedWebLogicServer log window, click on ‘Actions’ and select ‘Configure Oracle Diagnostic Logging’. This will open up logging.xml file in a configurable UI.
You can setup the log levels here for your module or package and the logging will instantaneously be switched on without restarting the weblogic instance.
For the demo, we have setup a custom logger at ‘FINEST’ level for ‘com.ofa’. ‘FINEST’ level encompasses all the logging done at the other levels.
In order to define your own custom logger, click on to add either ‘Persistent’ or ‘Transient’ logger.
Persistent logger is a permanent entry into the logging.xml file while as Transient logger is temporary to that particular session.
Once this setup has been completed, we can now go ahead and insert the coding logic to our existing application.
Logging code has been inserted into one of the managedBeans code as below:
Basically, we defined a logger at the class level and used its methods all over the code. Once done, redeploy the application and run the transaction.
Now go back to JDeveloper and the integratedWebLogicServer log, click on ‘Actions’ à ‘Analyze Log’ à ‘Current in Console’.
In the Oracle Diagnostic Log Analyzer screen, you will see two options: By ADF Request and By Log Message. ‘By ADF Request’ option shall be explored in subsequent newsletter.
If you select ‘By Log Message’ and give appropriate interval, you should be getting the custom log messages.

















