Stephen McConnell wrote:
Noel J. Bergman wrote:
Stephen McConnell wrote:
Noel J. Bergman wrote:
While on this topic ... James is a Mailet container. We have a single log channel for all Mailet log messages. However, James might want to change the priority so that a particular mailet uses DEBUG priority while others are at the default. I see that Logger.getPriority is deprecated. What is the recommended solution? Are we supposed to create a child logger just to be able to control the priority?
Yes.
I'll have to log more into LogKit to see what help it provides to us for
managing that situation. And yes, I have read Berin's message about
channels (log destinations) and targets (log specifiers), so I supposed we
could check for the presence of a child log for the mailet, e.g.,
"mailet.<class>", and use the mailet log if the child log is not found in
the environment.
The other thing I want to do (or see someone else do, if they've time) is to
separate out protocol logging from in-line with the rest of the service,
e.g., the SMTP server would have its normal log and a protocol log as a
child. The latter would have just the wire-level messages. That would
allow keeping the normal log information as part of standard administrative
practices, and allow keeping a "recent history" of wire-level transactions.
For example, I don't normally keep the wire-level data, but there are
occasions where I want to see what is happening. Being able to have a size
limited log, keeping say the last 1MB (or N log messages) of wire-level
information (not DATA) would be helpful.
I know we can rotate on size, but what would be the easiest way to keep just
the above sort of size limited log? Is there a suitable log implementation
already provided?
The way I deal with this is to create child loggers to seperate out these sort of concerns. In the SMTP server you are suipplied a logger and in the code you can invoke something like:
Logger protocolLogger = getLogger().getChildLogger( "protocol" );
In you log configration you should be able to declare a seperate priority and possible seperate target for the james.smtp.protocol logging category.
Steve.
p.s. Under the new Avalon Meta package your components can declare the internal logging channels that it consumes. This information can be used to automate jmx based controls that will (in the near future) enable interactive control of logging channel priorities and targets for components.
SJM.
--
Stephen J. McConnell mailto:[EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
