Logging in WebCenter Analytics with log4j.properties

Stay tuned for a flurry of Analytics posts, boys and girls, because recently I had a really bad day fighting WCI Analytics after a 10gR3 upgrade.  Let’s kick this off with something simple: logging.  Well, you’d THINK logging would be simple, right?  You’d just go into PT_HOME\ptanalytics\10.3.0\settings\config\wrapper.conf, and change some of the settings under “# Wrapper Logging Properties”, and restart the service. 

No, friends, that would be too easy.  This setting only controls the WRAPPER log, which pretty much does nothing but write thousands of messages like this if you turn on DEBUG:

DEBUG  | wrapperp | 2010/04/14 01:12:33 | send a packet PING : ping
INFO   | jvm 1    | 2010/04/14 01:12:33 | Received a packet PING : ping
INFO   | jvm 1    | 2010/04/14 01:12:33 | Send a packet PING : ok
DEBUG  | wrapperp | 2010/04/14 01:12:33 | read a packet PING : ok
DEBUG  | wrapper  | 2010/04/14 01:12:33 | Got ping response from JVM

Instead you have to edit the log4j.properties file.  Another piece of cake, right?  There’s a log4j file in that config folder for hibernate, synch, analytics25Update, and analyticsLoadEvents, so it’s got to be somewhere in there.

No, friends, THAT would be too easy.  Instead, the log4j file you actually need to change to get usable debug messages in analyticsui.log is packaged inside the analytics.war file itself.  There are lot of ways to change and repackage the log4j.properties file into the .war while still preserving the WEB-INF/classes path, but here’s how I did it with my old friend, Beyond Compare.  Basically, I pull the log4j.properties out of the .war, edited it, and use Beyond Compare to jam it back in there:

Bonus tip – if you find Analytics is writing a ton of entries to the application event log, this one IS actually in the wrapper.conf file.  Just set the following to some high threshold like FATAL:

# Log Level for sys/event log output.  (See above for log levels)

Tags: ,

Leave a Reply