Page 1 of 1

Fun with Logging...

Posted: Wed Nov 07, 2012 2:20 am
by fleaster
Ok, so I have been dabbling with the tm1s-log.properties file on our TM1 9.5.2 server - basically I would like the level of logging to be INFO for all events, except SQLAPI messages, which should be set to WARN.

I added the statement "log4j.logger.TM1.SQLAPI=WARN" to my tm1s-log.properties file below, but doesn't seem to be working as expected... anyone have any ideas what went wrong with my code? :(

Cheers,

Matt

Code: Select all

#
#  Enable INFO level logging through the shared memory appender, by default.  The server 
#  will write informational messages, as well as errors and warnings to the log file.
#

# 
log4j.rootLogger=INFO, S1
log4j.logger.TM1=INFO, S1

### Added to reduce SQLAPI messages...
### e.g.  6624 [f] INFO 2012-08-03 06:16:53.036 TM1.SQLAPI fetched 1 row
log4j.logger.TM1.SQLAPI=WARN

# S1 is set to be a SharedMemoryAppender
log4j.appender.S1=org.apache.log4j.SharedMemoryAppender
log4j.appender.S1.File=tm1server.log

# Specify the size of the shared memory segment
log4j.appender.S1.MemorySize=5 MB

# Specify the max filesize
log4j.appender.S1.MaxFileSize=20 MB

# Specify the max backup index
log4j.appender.S1.MaxBackupIndex=20

# S1 uses PatternLayout
log4j.appender.S1.layout=org.apache.log4j.PatternLayout
log4j.appender.S1.layout.ConversionPattern=%t   %p   %d{%Y-%m-%d %H:%M:%S,%Q}   %c   %m%n

# Specify GMT or Local timezone
log4j.appender.S1.TimeZone=Local

Re: Fun with Logging...

Posted: Wed Nov 07, 2012 9:01 pm
by jameswebber
This is my log properties if it helps:

Code: Select all

log4j.logger.TM1=INFO, S1
log4j.logger.TM1.SQLAPI=WARN
log4j.logger.TM1.Comm.SSL=WARN

# S1 is set to be a SharedMemoryAppender
log4j.appender.S1=org.apache.log4j.SharedMemoryAppender
# Specify the size of the shared memory segment
log4j.appender.S1.MemorySize=5 MB
# Specify the max filesize
#JW dropped this to 30 as 100 MB seems to not be in effect
log4j.appender.S1.MaxFileSize=30 MB
# Specify the max backup index
log4j.appender.S1.MaxBackupIndex=20
# Specify GMT or Local timezone
log4j.appender.S1.TimeZone=Local

Re: Fun with Logging...

Posted: Wed Nov 07, 2012 10:24 pm
by fleaster
Thanks for that - well I ended up settling for "log4j.logger.TM1.SQLAPI=WARN, S1" , which seems to work ok now ie the generic INFO messages are excluded, but it still includes WARN messages etc

Matt

Code: Select all

# 
log4j.rootLogger=INFO, S1
log4j.logger.TM1=INFO, S1

# 121107-reduce SQLAPI messages
log4j.logger.TM1.SQLAPI=WARN, S1

# S1 is set to be a SharedMemoryAppender
log4j.appender.S1=org.apache.log4j.SharedMemoryAppender
log4j.appender.S1.File=tm1server.log

# Specify the size of the shared memory segment
log4j.appender.S1.MemorySize=5 MB

# Specify the max filesize
log4j.appender.S1.MaxFileSize=50 MB

# Specify the max backup index
log4j.appender.S1.MaxBackupIndex=20

# S1 uses PatternLayout
log4j.appender.S1.layout=org.apache.log4j.PatternLayout
log4j.appender.S1.layout.ConversionPattern=%t   %p   %d{%Y-%m-%d %H:%M:%S,%Q}   %c   %m%n

# Specify GMT or Local timezone
log4j.appender.S1.TimeZone=Local

Re: Fun with Logging...

Posted: Tue Nov 20, 2012 8:19 pm
by ps_in_atl
Does anyone know where we can get a list of the different loggers (individual parts we can control)? IBM documentation says to ask Customer Support, but you know how that goes...

Re: Fun with Logging...

Posted: Tue Nov 20, 2012 11:49 pm
by fleaster
Hi ps,
the link I was given by someone previously was to the LOG4J site: http://logging.apache.org/log4j/1.2/manual.html

...it details all the different components of the logger... personally, I found it a bit hard to follow :p

Matt