How to Register Custom ODL Logger in OIM?

Go to following location:

$MW_HOME/user_projects/domains/base_domain/config/fmwconfig/servers/oim_server1

Here we can find logging.xml

Open logging.xml and add the below snippet:

·         First add the below code under <log_handlers> </log_handlers>

<log_handler name='CustomLog' level='FINEST' class='oracle.core.ojdl.logging.ODLHandlerFactory'>
          <property name='logreader:' value='off'/>
          <property name='path' value='${domain.home}/servers/${weblogic.Name}/logs/testlog.log'/>
          <property name='format' value='ODL-Text'/>
          <property name='useThreadName' value='true'/>
          <property name='locale' value='en'/>
          <property name='maxFileSize' value='5242880'/>
          <property name='maxLogSize' value='52428800'/>
          <property name='encoding' value='UTF-8'/>
   </log_handler>

·         Second add the below code under <logger> </logger>

  <logger name='EventHandlerLogger' level='TRACE:32' useParentHandlers='false'>
        <handler name='CustomLog'/>
        <handler name='console-handler'/>
  </logger>

Note: Once log handler and logger statements are added in logging.xml, execute ‘xmllint --valid logging.xml’ command to verify if all statements are added and there is no syntax error.

Now you can use below line in your java class:


private static ODLLogger logger = ODLLogger.getODLLogger("EventHandlerLogger");

No comments:

Post a Comment