camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: [SPAM] Re: Custom log messages
Date Tue, 16 Sep 2008 10:41:19 GMT
Hi

You can prefix the categoy (package name) with the same prefix

To("log:com.mycompany.ValidatingAgainstXMLSchema")
To("log:com.mycompany.ValidationOK")

And have them logged in the same file

log4j.logger.com.mycompany = special

log4j.appender.special=org.apache.log4j.FileAppender
log4j.appender.special.layout=org.apache.log4j.PatternLayout
log4j.appender.special.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
log4j.appender.special.file=myspecial.log
log4j.appender.special.append=true



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: 16. september 2008 12:34
To: camel-user@activemq.apache.org
Subject: [SPAM] Re: Custom log messages

2008/9/16 raulvk.soa <raulvk.soa@gmail.com>:
> Nevermind. Sorry I got confused. Obviously you can make different log
> categories use the same Appender!
>
> That would be a temporary solution, as architecturally speaking we would be
> overloading the log4j with an awful amount of loggers, which I am not happy
> doing.
>
> Do you think it is feasible to achieve this by extending the Logger class
> and using it as a processor? What method would I have to override? Any
> special considerations? I think I may attempt to do this...

I'm not quite sure I follow. Claus's example uses a single Logger
called "ValidatingAgainstXMLSchema" or whatever. i.e. you can use a
single Logger if you want - the URI log:foo defines the logger to use.
There's not one per message or anything like that. Each different log
URI uses a different logger, so its up to you to define how many
different logger/categories you want to use.

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

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

Mime
View raw message