camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: [SPAM] Re: Custom log messages
Date Tue, 16 Sep 2008 11:26:05 GMT
2008/9/16 raulvk.soa <raulvk.soa@gmail.com>:
>
> Yep, I just realised that was possible.
>
> Do you know if there is a way to get rid of the full category name and only
> print out the last token on the log file? i.e. print out
> "ValidatingAgainstXMLSchema" instead of
> "com.mycompany.ValidatingAgainstXMLSchema".
>
> I am aware that I can truncate it at a fixed position, but I cannot
> guarantee that my final tokens will all be the same length...

Using this config tends to just print the last path of the category

log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n

For more information see
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html

i.e. use %c{x} where x is the number of right hand paths to print, so
%c{1} just prints the last one

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message