You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Elliott Yates <el...@yahoo.com> on 2005/06/16 16:19:55 UTC

J2EE - rolling appenders and filters in configuration files

Hello,
I'm a new user to the mailing list, so my apologies if
my questions are
frequently addressed. Please direct me to the
appopriate forum or
resource if possible.

1. I'm working with a J2EE application using log4j. We
have multiple
instances of an application server running. Originally
we were using 
the
same application output file (with
DailyRollingFileAppender) but we saw
resource contention issues with the single copy of the
file, especially
at midnight when each app server attempted to roll it
over. Our current
fix is to extend DailyRollingFileAppender and override
the setFile()
method from FileAppender so that the log file name
incorporates the
server name. Is there a better way to do this?

2. There is at present only one appender logging
information, and it is
quite verbose. I'd like to add another appender
temporarily (for
alerting purposes) that will register only error
messages. However, I'd
like to be able to configure which error messages are
logged using the
run-time configuration file, instead of adding Filters

programmatically.
Is it possible to filter error messages by
text-matching based on
configuration files? (we're currently using flat text
key-value pair config files)

3. I have come across the following line in a
configuration file:
log4j.category.log4j.Sort=INFO
I'm not sure what this .Sort property is doing, and I
cannot find it
used in any example configurations in technical docs
on the web. Any
idea what this is? My assumption is that it is being
ignored by log4j
(as it is unrecognized).

Thank you kindly for your time and help.
Sincerely,
Elliott Yates.


		
__________________________________ 
Discover Yahoo! 
Have fun online with music videos, cool games, IM and more. Check it out! 
http://discover.yahoo.com/online.html

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: J2EE - rolling appenders and filters in configuration files

Posted by James Stauffer <st...@gmail.com>.
On 6/16/05, Elliott Yates <el...@yahoo.com> wrote:
> 1. I'm working with a J2EE application using log4j. We have multiple
> instances of an application server running. Originally we were using the
> same application output file (with DailyRollingFileAppender) but we saw
> resource contention issues with the single copy of the file, especially
> at midnight when each app server attempted to roll it over. Our current
> fix is to extend DailyRollingFileAppender and override the setFile()
> method from FileAppender so that the log file name incorporates the
> server name. Is there a better way to do this?
If you want all of the output from multiple log4j instances to go to
one file I would suggest that all instances use a SocketAppender to
send them and they you have on program that listens
(ServerSocketListener?) and writes them to the file.

> 2. There is at present only one appender logging information, and it is
> quite verbose. I'd like to add another appender temporarily (for
> alerting purposes) that will register only error messages. However, I'd
> like to be able to configure which error messages are logged using the
> run-time configuration file, instead of adding Filters programmatically.
> Is it possible to filter error messages by text-matching based on
> configuration files? (we're currently using flat text key-value pair config files)
I haven't used filters but I know they can be in the config file so
take a close look at them.  You might also look into Chainsaw.

> 3. I have come across the following line in a configuration file:
> log4j.category.log4j.Sort=INFO
> I'm not sure what this .Sort property is doing, and I cannot find it
> used in any example configurations in technical docs on the web. Any
> idea what this is? My assumption is that it is being ignored by log4j
> (as it is unrecognized).
I haven't heard of that either (and I use XML config so I am not
familiar with the properties format).

-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org