|
From: Leif M. <le...@ta...> - 2006-09-13 13:14:48
|
Alexander,
All JVM console output from is sent to the wrapper process and then
logged at the INFO
level. You are currently disabling all output to the wrapper log file
with the following
setting:
wrapper.console.loglevel=NONE
Setting this to the following, should clear things up:
wrapper.console.loglevel=INFO
The log levels from log4j are different than the wrapper's log levels.
A log4j DEBUG
message logged to the console is simply printed to System.out with the
appropriate
timestamp and "DEBUG" info prefixed on each line. As said above, all
System.out
info is then piped to the wrapper process where it is logged at the
Wrapper INFO
log level.
If you print the following in log4j:
logger.debug( "My Message" );
you will get the following in the Java console:
09-11-2006 15:36:49 DEBUG My Message
You will then get the following in the wrapper log file:
INFO | jvm 1 | 2006/09/11 15:36:49 | 09-11-2006 15:36:49 DEBUG My
Message
Let me know if that doesn't make sense.
Cheers,
Leif
Ale...@st... wrote:
>
> Hi,
>
> I'm using log4j to output log messages. Now the application is running
> inside the wrapper on linux and I would like to use the trigger
> mechanism. But the trigger is only locking for the stuff that is
> logged by the wrapper itself.
>
> I thought that if would let log4j do its output to STDOUT it would
> arrive in the wrapper logfile, but nothing appears in the wrapper logfile.
>
> Please, can someone tell me how to get the log4j-output to the wrapper
> log so I can use the trigger?
>
> Here is my configuration.
>
> wrapper.conf:
> ...
> # Trigger
> wrapper.filter.trigger.1=java.lang.OutOfMemoryError
> wrapper.filter.action.1=RESTART
>
> #********************************************************************
> # 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=NONE
>
> # Log file to use for wrapper output logging.
> wrapper.logfile=/home/carlosad/bps/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=INFO
>
> # 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=5m
>
> # 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=1
>
> # Log Level for sys/event log output. (See docs for log levels)
> wrapper.syslog.loglevel=NONE
> ...
>
> log4j.conf:
> ...
> <!--
> STDOUT
> -->
> <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
> <param name="Target" value="System.out" />
> <layout class="org.apache.log4j.PatternLayout">
> <param name="ConversionPattern" value="%d %-5p (%F:%L) # %m\n" />
> </layout>
> </appender>
>
> <!--
> STDERR
> -->
> <appender name="STDERR" class="org.apache.log4j.ConsoleAppender">
> <param name="Target" value="System.err" />
> <layout class="org.apache.log4j.PatternLayout">
> <param name="ConversionPattern" value="%d %-5p [%t] %c %C{3} (%F:%L) #
> %m\n" />
> </layout>
> </appender>
> ...
> <root>
> <priority value="warn" />
> <appender-ref ref="FILE_ERROR" />
> <appender-ref ref="STDOUT" />
> <appender-ref ref="STDERR" />
> </root>
>
> </log4j:configuration>
>
> Thanks in advance
> Alex
>
|