logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno Melloni" <Bruno.Mell...@wnco.com>
Subject Passing log-time values to the Appender
Date Fri, 15 Aug 2008 20:19:46 GMT
I have an app that makes all Logger calls happen from a single class and
it uses a custom appender.  I need to modify the appender so that it
splits the logging to separate logs for each city.  The city code is
available in the calling class and is also being prefixed as the first 3
characters of every message.
I know I could create an appender for each city... but that would be
insane since there are too many cities.
I suspect that the cleanest way would be to 'somehow' pass the city as a
parameter when calling logger.info() and 'somehow' customize the
appender so that it can read the value and select which file to add it
to.  Is this possible with log4j?  If so, how?
Or, is there a better way to separate the logs?

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