You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2003/10/03 18:24:47 UTC

RE: Excalibur Logger Improvements

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?

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Excalibur Logger Improvements

Posted by Stephen McConnell <mc...@apache.org>.

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:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Excalibur Logger Improvements

Posted by Stephen McConnell <mc...@apache.org>.

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:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: Excalibur Logger Improvements

Posted by Stephen McConnell <mc...@apache.org>.

Noel J. Bergman wrote:

>>>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.
>>    
>>
>
>Yes, I understood that, Steven, although I thank for you the clear
>explanation.  You will find almost that exact line of code in James.java
>where it gets the mailet logger, since the Mailet log is a child of the
>James log.
>
>The question wasn't how to get the protocol logger, but rather how to have a
>log file limited to either a certain size or number of log entries.  I'm
>only familar with the rotation scheme, which could be used to rotate when
>the log reaches a limit, but that doesn't appear to directly handle the
>issue of keeping just the most recent messages, without having an external
>process deleting the old logs.
>

I had a sneaking suspision that I may have been ansering the wrong 
question!  Sorry about that.  What your describing about if a particular 
policy on a log target.  I honestly don't know much aboput this area - 
but just looking at the javadoc - my guess is that what you are 
describing is an file stategy with "append" enabled, "size" limit 
declared and no rotation strategy.  But I'm guessing!
 
Stephen.

>
>	--- Noel
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>For additional commands, e-mail: dev-help@avalon.apache.org
>
>
>  
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: Excalibur Logger Improvements

Posted by Stephen McConnell <mc...@apache.org>.

Noel J. Bergman wrote:

>>>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.
>>    
>>
>
>Yes, I understood that, Steven, although I thank for you the clear
>explanation.  You will find almost that exact line of code in James.java
>where it gets the mailet logger, since the Mailet log is a child of the
>James log.
>
>The question wasn't how to get the protocol logger, but rather how to have a
>log file limited to either a certain size or number of log entries.  I'm
>only familar with the rotation scheme, which could be used to rotate when
>the log reaches a limit, but that doesn't appear to directly handle the
>issue of keeping just the most recent messages, without having an external
>process deleting the old logs.
>

I had a sneaking suspision that I may have been ansering the wrong 
question!  Sorry about that.  What your describing about if a particular 
policy on a log target.  I honestly don't know much aboput this area - 
but just looking at the javadoc - my guess is that what you are 
describing is an file stategy with "append" enabled, "size" limit 
declared and no rotation strategy.  But I'm guessing!
 
Stephen.

>
>	--- Noel
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>For additional commands, e-mail: dev-help@avalon.apache.org
>
>
>  
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


RE: Excalibur Logger Improvements

Posted by "Noel J. Bergman" <no...@devtech.com>.
> >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.

Yes, I understood that, Steven, although I thank for you the clear
explanation.  You will find almost that exact line of code in James.java
where it gets the mailet logger, since the Mailet log is a child of the
James log.

The question wasn't how to get the protocol logger, but rather how to have a
log file limited to either a certain size or number of log entries.  I'm
only familar with the rotation scheme, which could be used to rotate when
the log reaches a limit, but that doesn't appear to directly handle the
issue of keeping just the most recent messages, without having an external
process deleting the old logs.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


RE: Excalibur Logger Improvements

Posted by "Noel J. Bergman" <no...@devtech.com>.
> >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.

Yes, I understood that, Steven, although I thank for you the clear
explanation.  You will find almost that exact line of code in James.java
where it gets the mailet logger, since the Mailet log is a child of the
James log.

The question wasn't how to get the protocol logger, but rather how to have a
log file limited to either a certain size or number of log entries.  I'm
only familar with the rotation scheme, which could be used to rotate when
the log reaches a limit, but that doesn't appear to directly handle the
issue of keeping just the most recent messages, without having an external
process deleting the old logs.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Excalibur Logger Improvements

Posted by Stephen McConnell <mc...@apache.org>.

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.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Excalibur Logger Improvements

Posted by Stephen McConnell <mc...@apache.org>.

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.

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org