|
From: Sushil D. <sus...@gm...> - 2008-07-07 21:31:43
|
Hi all, i am using a Java Wrapper and a Quartz schedular to trigger certain processes. i have configured my applications logging to the console from where the wrapper picks that stuf and loggs it in the logfile. i.e. my Log4j.properties refelects # Set root category priority to INFO and its only appender to CONSOLE the wrapper will log everything on the console to the #log file so that there won't be two processes trying to get the lock on the log file and the which might cause problmes. #log4j.rootCategory=INFO, CONSOLE log4j.rootCategory=INFO, CONSOLE # CONSOLE is set to be a ConsoleAppender using a PatternLayout. log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n while my wrapper configuration file snippet is as below #******************************************************************** # Wrapper Logging Properties #******************************************************************** # Format of output for the console. (See docs for formats) wrapper.console.format=PM # Log Level for console output. (See docs for log levels) wrapper.console.loglevel=INFO # Log file to use for wrapper output logging. wrapper.logfile=../logs/wrapper.log # Format of output for the log file. (See docs for formats) wrapper.logfile.format=LPTM # Log Level for log file output. (See docs for log levels) wrapper.logfile.loglevel=DEBUG # Maximum size that the log file will be allowed to grow to before # the log is rolled. Size is specified in bytes. The default value # of 0, disables log rolling. May abbreviate with the 'k' (kb) or # 'm' (mb) suffix. For example: 10m = 10 megabytes. wrapper.logfile.maxsize=20m # Maximum number of rolled log files which will be allowed before old # files are deleted. The default value of 0 implies no limit. wrapper.logfile.maxfiles=20 # Log Level for sys/event log output. (See docs for log levels) wrapper.syslog.loglevel=NONE now my issue is this kind of logging loggs everything as expected but as my process runs 24 X 7 the log files are very big (i used the rolling) as i could see some redundant log statements of the wrapper and the JVM increasing the file size e.g. INFO | jvm 1 | 2008/07/07 16:12:21 | Send a packet PING : ok DEBUG | wrapperp | 2008/07/07 16:12:21 | read a packet PING : ok DEBUG | wrapper | 2008/07/07 16:12:21 | Got ping response from JVM DEBUG | wrapperp | 2008/07/07 16:12:25 | send a packet PING : ping INFO | jvm 1 | 2008/07/07 16:12:25 | Received a packet PING : ping INFO | jvm 1 | 2008/07/07 16:12:25 | Send a packet PING : ok DEBUG | wrapperp | 2008/07/07 16:12:25 | read a packet PING : ok DEBUG | wrapper | 2008/07/07 16:12:25 | Got ping response from JVM DEBUG | wrapperp | 2008/07/07 16:12:29 | send a packet PING : ping INFO | jvm 1 | 2008/07/07 16:12:29 | Received a packet PING : ping INFO | jvm 1 | 2008/07/07 16:12:29 | Send a packet PING : ok DEBUG | wrapperp | 2008/07/07 16:12:29 | read a packet PING : ok DEBUG | wrapper | 2008/07/07 16:12:29 | Got ping response from JVM DEBUG | wrapperp | 2008/07/07 16:12:33 | send a packet PING : ping INFO | jvm 1 | 2008/07/07 16:12:33 | Received a packet PING : ping INFO | jvm 1 | 2008/07/07 16:12:33 | Send a packet PING : ok DEBUG | wrapperp | 2008/07/07 16:12:33 | read a packet PING : ok DEBUG | wrapper | 2008/07/07 16:12:33 | Got ping response from JVM DEBUG | wrapperp | 2008/07/07 16:12:37 | send a packet PING : ping INFO | jvm 1 | 2008/07/07 16:12:37 | Received a packet PING : ping INFO | jvm 1 | 2008/07/07 16:12:37 | Send a packet PING : ok DEBUG | wrapperp | 2008/07/07 16:12:37 | read a packet PING : ok can these statements be filtered or can they be stopped from going in to the log file? the only option i could see is seperating the loggs of the wrapper and my application in 2 diff files but that is a very crude way to maintain 2 same logs in diffrent files. any suggestions on this? regards, Sushil |