----- Original Message ----- From: Paul Smith <[EMAIL PROTECTED]> To: Log4J Users List <[email protected]> Sent: Tue Oct 30 17:52:24 2007 Subject: Re: Alternative Logger naming strategies?
On 31/10/2007, at 6:57 AM, Paul Duffy wrote: > Hi, > > Wrestling with some product requirements. > My app will be deployed to a JEE container, which is using the > typical class based Logger naming convention. > > The beans deployed to the container need finer grained control of > the logging event generation. Compile time setting of DEBUG, WARN, > INFO, etc. level is not adequate. There is a desire to provide > explicit, individual on/off control of all logging events. > > Wondering what common Logger naming strategies are used (versus > class based naming). > This is what I tried to achieve with the LoggingDomain hackathon project I built up. You can see the results here: http://svn.apache.org/repos/asf/logging/sandbox/LoggingDomains/ The principle is that each class is annotated so that it's logging events are grouped into domains. Each class can belong to many domains, and you have JMX controls available to set levels per domain, automatically reflecting level changes in the underlying loggers that belong to them. What the LoggingDomains hackathon project didn't set out to try was to allow XML configuration of the domain groupings allowing runtime control. that would be nice. Might be worth investigating, otherwise James' example is also common, prefixing the logger with a domain concept is also common, although you can only choose one domain. cheers, Paul
