Create new log in ADF Logging

In this post explain how to create a new log for our ADF applications.

First of all we should create a new handler and logger in a logging.xml.

The logging.xml is in:

  • ${domain.home}/config/fmwconfig/servers/${domain.home}/logging.xml

i.e In the embedded WebLogic is in:

  • ${YourUserFolder}/AppData\Roaming\JDeveloper\system${versionNumber}\DefaultDomain\config\fmwconfig\servers\DefaultServer

Create a new Handler

<log_handler name='MyHandler' class='oracle.core.ojdl.logging.ODLHandlerFactory' filter='oracle.dfw.incident.IncidentDetectionLogFilter'>
<property name='path' value='${domain.home}/servers/${weblogic.Name}/logs/${weblogic.Name}-MyLogging.log'/>
<property name='maxFileSize' value='10485760'/>
<property name='maxLogSize' value='104857600'/>
<property name='encoding' value='UTF-8'/>
<property name='useThreadName' value='true'/>

Register a new log to use the new Handler

<logger name='MyLogging' level='FINEST'>
<handler name='MyHandler'/>

And finally we can use own log.

private static ADFLogger myLog = ADFLogger.createADFLogger("MyLogging");

For more info about ADF Logging see these links: