Logging made easy in OAM 11g with this simple trick!

August 8, 2014 | 2 minute read
Tim Melander
A-Team Cloud Solution Architect
Text Size 100%:

INTRODUCTION

 

This post is part of a larger series on Oracle Access Manager 11g called Oracle Access Manager Academy. An index to the entire series with links to each of the separate posts is available.

Logging is extremely helpful when trying to troubleshoot issues and normally when you see instructions to log in OAM 11g there is documentation on using WLST commands with several steps or Enterprise Manager that can be used to set various log levels, but in both cases this can be a bit tedious.  Wouldn't it be great if you could just update some file like in the old OAM 10g days using the oblog_config.xml or something similar; see  http://docs.oracle.com/cd/E12530_01/oam.1014/b32419/log.htm.  Well I am going to give you a little known trick that can provide you this very thing.  Welcome to updating the logging.xml file and it does this in real time without any restarts needed to add or remove logging!!  Read on....

 

How to Configure Logging using a simple XML file.

There is a little known secret where you can update the logging.xml file.  The following steps will show you how to add logging that is persistent even if you restart the managed server.  NOTE: Now in 11.1.2.2.0 or later in Enterprise Manager there is an option to make logging persistent by using a check box.

 

  1. Go to $IAM_DOMAIN/config/fmwconfig/servers/<ServerName>/; where <ServerName> is the server name to change logging like oam_server1.
  2. Make a backup of logging.xml
  3. Edit logging.xml
  4. Search  for "loggers”, you should find the first line below <logger name='' level='WARNING:1'>.
  5. You can add one or more lines as needed above <logger name='' level='WARNING:1'> as follows; below are a couple examples showing two loggers.
    <logger name='oracle.oam.user.identity.provider' level='TRACE:16'/><logger name='oracle.ods.virtualization' level='TRACE:16’/>
  6. NO RESTART --- Once you save the change logging should start after a few seconds.
  7. Follow this link to learn more details on various modules you can use in the logging.xml file http://docs.oracle.com/cd/E40329_01/admin.1112/e27239/logging.htm#CHDIBAHF.
  8. To stop the logging simply remove the lines that were added from the logging.xml and save, or revert the logging.xml backup file.
 
The key is adding the proper module to the name='<MODULE>' value and the logging level='<LEVEL>' for the logging level where <MODULE> is something like oracle.ods.virtualization and <LEVEL> is the logging level like TRACE:16; note TRACE:32 may also been required to get more fine grain detail depending on the problem you are troubleshooting.  Be careful when updating the logging.xml file for formatting and using the correct loggers.  To be safe use the examples I give as a template along with finding the right module to log.  If you do not feel comfortable doing this I would highly recommend using Enterprise Manager because there is no room for error.
 

Summary

This trick may not be for everyone.  For example in a production environment there may be security lock downs for good reason to prevent updating or even accessing certain files, so Enterprise Manager still may be the best choice.  However for those that may be working in a non-production environment that have access to this configuration file, this trick may be your very best friend.  Happy logging!!

Tim Melander

A-Team Cloud Solution Architect

I started with Oracle in 2005 and been a member of the Oracle A-Team since 2012 though have worked in Identity and Access Management since 1999.  My journey with security continues the cloud that heavily includes Oracle Infrastructure Cloud (OCI).  I enjoy writing articles built on real life use cases to help in areas where a standard document may not provide. I am a strong believer in learning by example to which I try to incorporate as many helpful tips, excellent diagrams, and instructional steps as I can.


Previous Post

Extending the Oracle Sales Cloud with SOA Suite

Gerhard Drasch | 5 min read

Next Post


Understanding the use of "WebLogic Plugin Enabled"

Naveen Nahata | 6 min read