logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Huber, Stephan" <Stephan.Hu...@gigatronik.com>
Subject Log4j - do only log statements for my application
Date Tue, 04 May 2010 12:32:47 GMT

I've some questions regarding log4j. My app (war) is deployed on an
application server where multiple web-apps have also been deployed.

Today, after analyzing the logs, I realized that my logging outputs
somehow overwrite logging statements from another application (all the
apps log to the default rotating server log file).

Here's my configuration of log4j - log4j.properties:
log4j.rootCategory=DEBUG, CONSOLE
### direct log messages to console ###
log4j.appender.CONSOLE.layout.ConversionPattern=[EHS] %d{ABSOLUTE} %-5p
[%c{1}] %m%n
### direct messages to file material-prisma-import.log ###
#log4j.appender.file.layout.ConversionPattern=[EHS] %d{ABSOLUTE} %5p
%c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug'
log4j.rootLogger=INFO, CONSOLE

I prepend the string "[EHS]" for every logging statement of my app and
was wondering today why this string is prepended for logging statements
of another application, too. Is it because my app specifies a root
logger (so the other configuration gets overriden)? How should my
configuration look like to only log statements relevant for my
application and do not affect other applications on the same app.

Any help would be appreciated.

Thanks and best regards,

- Stephan 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message