Wednesday 30 May 2018

Enabling Custom Logging in OIM

  • The logger configuration file is present at below location 
/appl/iam/middleware/user_projects/domains/oim_domain/config/fmwconfig/servers/oim_server1 /logging.xml 
  •  IMPORTANT NOTE:  
  Take the backup of the logging.xml file before updating any new changes.

Steps Followed: 

  • Add the log_handler as required in the xml file. Below example shows the log_handler structure.  
<log_handler name='My-Test-handler' level='FINEST' class='oracle.core.ojdl.logging.ODLHandlerFactory'>
<property name='logreader:' value='off'/>
<property name='path' value='/appl/iam/middleware/user_projects/domains/oim_domain/servers/oim_server1/logs/Custom/MyTestLog.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> 
  • Include the log_handler added in the loggers section.Below example shows the format to add the log_handler. 
<loggers>             
<logger name="MyTestLogger" level="TRACE:32" useParentHandlers="false">
<handler name="My-Test-handler"/>
<handler name="console-handler"/>
</logger>  

  •  Create the object of the logger class in the java code written for OIM. Below mentioned lines of code shows the package to be imported and the logger class to be created in the java class. 
import oracle.core.ojdl.logging.ODLLogger;
public class TestClass {
      ODLLogger logger = ODLLogger.getODLLogger("MyTestLogger");
protected void testMethod(String resourceObject) {
logger.info("its my test log message");
}} 
  • The logging level can be chosen as required. PFB table.
Java Level
ODL Message Type: Level
SEVERE.intValue()+100
INCIDENT_ERROR:1
SEVERE
ERROR:1
WARNING
WARNING:1
INFO
NOTIFICATION:1
CONFIG
NOTIFICATION:16
FINE
TRACE:1
FINER
TRACE:16
FINEST
TRACE:32





  






No comments:

Post a Comment

   Here we are going to discuss the steps required in detail, to extend a connector in OIM for provisioning to target system. Steps are s...