Monday, February 24, 2014

Configuring logging for ADF application

In this post i will show you how to configure ADF logger that logs your messages/errors to a specific log file.  Here are the steps needed to do the configuration.

1. In JDeveloper right click IntegratedWeblogicServer instance, and choose Configure Oracle Diagnostic logging for "IntegratedWeblogicServer".



2. Choose the root logger, and in structure window expand log_handlers, copy log_handler named "old-handler".

3. Paste the copied log_handler and name it XX-custom-handler, from property window change .



4. Choose the path property and change its default value.



5. In the overview tab of logging.xml file, click the add symbol to add a persistent logger. In the logger name select the class file or package for which you want to use this logger. example : xx.oracle.app select a level based on the severity you need.
 




6. Expand the Root logger and choose the newly created logger, and in the handler declarations window press the add icon, and choose the custom handler.



7. Now select your project in the application window, and double click it to change the run configuration java options -> Choose the default run configuration -> Edit -> Java options and add the following option "-Djbo.debugoutput=adflogger".







8. Now you can use the ADFLogger util to create a logger instance that logs to you log file.


Done.

No comments:

Post a Comment