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 Thomas Muller <tt...@online.no> on 2003/06/30 17:44:08 UTC

Multiple configuration files - single contra multiple hierarchies

Fellow Log4j users,

Would appreciate some input on how to design a solution for a problem I'm
facing regarding multiple Log4j configuration files.

One of the modules in our system (the module consists of a significant
number of classes) is in the process of being redesigned such that the
system can handle multiple "instances" of it. The log configuration for the
whole system is now contained in a single log4j XML configuration file, but
in the new design the configuration will be distributed in order to
accommodate the said requirement. Without any deep knowledge of Log4j, I
believe I have two options regarding Logger naming schemes:

1. Use the same hierarchy for all modules
2. Use multiple hierarchies (one for each module).

The consequence of 1) is that I must design a naming scheme such that Logger
names in the different modules don't collide. A simple approach would be to
add a suffix to each Logger name (i.e a module ID). E.g. Logger x, y, z
would become x.ID1, y.ID1, z.ID1 for module ID1 and x.ID2, y.ID2, z.ID2 for
module ID2. In this way the system can also benefit from accumulated logging
(e.g. having a separate appender for Logger "x".

The consequence of 2) is completely separate naming hierarchies for all
modules, and consequently full freedom with respect to Logger naming. I will
loose accumulated logging though.

My question is; which approach do you consider best? How easy is 2) to set
up/maintain? Are there any other approcaches that I've overlooked?

We're using Log4j version 1.2.6.

Any input/thoughs/ideas would be much appreciated.

Thanks,

--

Thomas




*************************************************************************
Copyright ERA Technology Ltd. 2003. (www.era.co.uk). All rights reserved. 
The information supplied in this Commercial Communication should be treated
in confidence.
No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________

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