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 alex mazour <a....@motorola.com> on 2005/03/21 17:59:00 UTC

Displaying custom log level in Chainsaw v2

Hi guys,

I have a problem where Chainsaw 2 will not display custom log level correctly. 
It displays the actual log message, but log level is wrong, i.e. DEBUG instead 
of custom log level. I did find a brief desription of how to make Chainsaw 2 to 
display custom log level in the email from Scott Deboy posted last year. It 
talks about writing a custom Level class and XmlDecoder.

I wonder if anythind has changed since than wrt custom log level display in 
Chaninsaw 2. If not, I'd appreciate any details on how to configure Chainsaw 2 
to display custom log level.

Thanks in advance,
Alex Mazour


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


Re: Displaying custom log level in Chainsaw v2

Posted by Paul Smith <ps...@aconex.com>.

alex mazour wrote:

>Paul Smith <psmith <at> aconex.com> writes:
>  
>
>>Unfortunately at this stage there is no support for custom levels inside 
>>Chainsaw v2. 
>>
>>Inside Chainsaw there is 2 classes that relate to displaying levels:
>>
>>* TableColorizingRenderer - this holds a Map of Levels->Icon, which is 
>>generated from..
>>* LevelIconFactory - this is where the Map is built up.  At the moment 
>>TRACE shares the DEBUG icon.
>>
>>What happens if you make Chainsaw display the Level as text instead of 
>>Icons ?  Does it come out correctly?
>>
>>Paul
>>    
>>
>
>
>In either mode (icon or text), it displays debug level, instead of custom level.
>Do you know how much work is to add support for custom log level.
>
>thanks,
>Alex
>
>  
>
Looking at this further, it is likely to be the deserialization of the 
LoggingEvent object (see the LoggingEvent.readObject() method in log4j 
1.3).  The Level class has no current way of registering custom levels 
to be able to decode an int level to it's object equivalent.  You would 
have to modify the Level.toLevel(int) methods to get the Level class you 
are after (and also have your custom Level available in the Chainsaw 
classpath).

Paul

Re: Displaying custom log level in Chainsaw v2

Posted by alex mazour <a....@motorola.com>.
Paul Smith <psmith <at> aconex.com> writes:

> 
> Probably not, there is still the issue of resolving the Level string/int 
> to a Level.  The log4j Level class needs to be changed to enable 
> 'registration' of custom levels, but I'm not sure how much of a priority 
> that is at this stage.
> 
> Paul
> 

You mentioned log4j Level class. But log4j already supports custom log levels. 
It's only the Chainsaw that is unable to handle them. If I were to fix the 
problem, I'll have to modify Chainsaw only. Is it right ?

Thanks,
Alex




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


Re: Displaying custom log level in Chainsaw v2

Posted by Paul Smith <ps...@aconex.com>.
Probably not, there is still the issue of resolving the Level string/int 
to a Level.  The log4j Level class needs to be changed to enable 
'registration' of custom levels, but I'm not sure how much of a priority 
that is at this stage.

Paul

alex mazour wrote:

>Paul Smith <psmith <at> aconex.com> writes:
>
>  
>
>>Which Receiver class are you using with Chainsaw? 
>>
>>Paul
>>
>>    
>>
>
>Currently, we do not use any receivers. Log4j logs data into a file in XML, and 
>then I load this file into Cnainsaw. Would a receiver make it easier to handle 
>custom log level ?
>
>Thanks again,
>Alex
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>  
>

Re: Displaying custom log level in Chainsaw v2

Posted by alex mazour <a....@motorola.com>.
Paul Smith <psmith <at> aconex.com> writes:

> >
> Which Receiver class are you using with Chainsaw? 
> 
> Paul
> 

Currently, we do not use any receivers. Log4j logs data into a file in XML, and 
then I load this file into Cnainsaw. Would a receiver make it easier to handle 
custom log level ?

Thanks again,
Alex




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


Re: Displaying custom log level in Chainsaw v2

Posted by Paul Smith <ps...@aconex.com>.
>In either mode (icon or text), it displays debug level, instead of custom level.
>Do you know how much work is to add support for custom log level.
>
>
>  
>
Which Receiver class are you using with Chainsaw? 

Paul

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


Re: Displaying custom log level in Chainsaw v2

Posted by alex mazour <a....@motorola.com>.
Paul Smith <psmith <at> aconex.com> writes:
> 
> Unfortunately at this stage there is no support for custom levels inside 
> Chainsaw v2. 
> 
> Inside Chainsaw there is 2 classes that relate to displaying levels:
> 
> * TableColorizingRenderer - this holds a Map of Levels->Icon, which is 
> generated from..
> * LevelIconFactory - this is where the Map is built up.  At the moment 
> TRACE shares the DEBUG icon.
> 
> What happens if you make Chainsaw display the Level as text instead of 
> Icons ?  Does it come out correctly?
> 
> Paul


In either mode (icon or text), it displays debug level, instead of custom level.
Do you know how much work is to add support for custom log level.

thanks,
Alex



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


Re: Displaying custom log level in Chainsaw v2

Posted by Paul Smith <ps...@aconex.com>.
Unfortunately at this stage there is no support for custom levels inside 
Chainsaw v2. 

Inside Chainsaw there is 2 classes that relate to displaying levels:

* TableColorizingRenderer - this holds a Map of Levels->Icon, which is 
generated from..
* LevelIconFactory - this is where the Map is built up.  At the moment 
TRACE shares the DEBUG icon.

What happens if you make Chainsaw display the Level as text instead of 
Icons ?  Does it come out correctly?

Paul

alex mazour wrote:

>Hi guys,
>
>I have a problem where Chainsaw 2 will not display custom log level correctly. 
>It displays the actual log message, but log level is wrong, i.e. DEBUG instead 
>of custom log level. I did find a brief desription of how to make Chainsaw 2 to 
>display custom log level in the email from Scott Deboy posted last year. It 
>talks about writing a custom Level class and XmlDecoder.
>
>I wonder if anythind has changed since than wrt custom log level display in 
>Chaninsaw 2. If not, I'd appreciate any details on how to configure Chainsaw 2 
>to display custom log level.
>
>Thanks in advance,
>Alex Mazour
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>  
>

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