Showing posts with label logging. Show all posts
Showing posts with label logging. Show all posts

Thursday, June 5, 2014

Logging in OIM custom code

Proper logging is one of the main considerations during custom development. This is no different in OIM projects in which custom code is being developed and deployed to OIM. Proper logging is fundamental part of development, helping in finding issues, fixing them and also in reporting relevant runtime conditions.

This post shows how to leverage the Oracle Fusion Middleware infrastructure in which OIM runs in order to create proper logging information from custom code. It is not the intent of this post to cover all logging considerations; there are plenty of materials on the internet and book stores to cover the basics.

Friday, February 24, 2012

My "enable debug logging" in OAM WLST script

I was on the phone with someone earlier today and mentioned in passing that I only need to run a simple script to turn debug logging on and off in my little test environment. The silence on the other end of the line told me either he didn't believe me or didn't realize how easy it is to do this sort of thing.

So here it is - enableOAMLogging.py

#!/home/oracle/Oracle/Middleware/Oracle_IAM1/common/bin/wlst.sh

connect('weblogic', 'ABcd1234', 't3://localhost:7010')
domainRuntime()

#Admin server:                                                                                                                                                                   
setLogLevel(logger="oracle.oam.plugin",level="TRACE:32", target="AdminServer", persist="0")
setLogLevel(logger="oracle.oam.extensibility",level="TRACE:32", target="AdminServer", persist="0")
setLogLevel(logger="com.oracleateam.iam.oamauthnplugin",level="TRACE:32",  target="AdminServer", persist="0",addLogger="1")

# OAM server                                                                                                                                                                     
setLogLevel(logger="oracle.oam.plugin",level="TRACE:32", target="oam_server1", persist="0")
setLogLevel(logger="oracle.oam.extensibility",level="TRACE:32", target="oam_server1", persist="0")
setLogLevel(logger="com.oracleateam.iam.oamauthnplugin",level="TRACE:32",  target="oam_server1", persist="0",addLogger="1")

listLoggers(pattern="oracle.oam.*",target="AdminServer")
listLoggers(pattern="com.oracleateam.iam.oamauthnplugin",target="AdminServer")


listLoggers(pattern="oracle.oam.*",target="oam_server1")
listLoggers(pattern="com.oracleateam.iam.oamauthnplugin",target="oam_server1")
disableOAMLogging.py is exactly the same except that it has lines like:
setLogLevel(logger="oracle.oam",level="", persist="1", target="oam_server1")
Setting level to the empty string toggles logging back to <Inherited>

Tuesday, November 2, 2010

OES Security Module Logging in WebLogic domains with Enterprise Manager

This isn't the "official" solution, but a quick note on how I jury rigged my logging to get it working.

Both the OES WebLogic SM and the Enterprise Manager seem to use log4j to do their logging. Since the SM spins up first you will see the normal sorts of things you'd expect in the OES SM's log file as the SM WebLogic server boots. Then suddenly the log juts stops.

This is because the Enterprise Manager app (EM) re-initializes the log4j system with its own config file. To solve it just add the lines you want from OES' log4j.properties to the config file ./config/fmwconfig/servers/AdminServer/applications/em/META-INF/emomslogging.properties

Hope this helps someone else!