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 Peter Munro <pe...@petermunro.org> on 2002/10/25 15:41:21 UTC

Logging to different destinations

Hi,

I want log output to go to 3 different destinations via Unix syslogd.
Reason: operations require syslogd support, to direct application errors,
system errors and user errors to appropriate people. Plus we can log to a
separate logging host.

So I'm using syslog facilities LOCAL1, LOCAL2 and LOCAL3 to identify the
'type' of message and hence its destination.

The trouble is, there's no way (I've seen) to select the facility at the
Logger level. Ideally I'd like to do:

  logger.error("local1", "Something went wrong");

or even:

  logger.error1("Something went wrong");


Currently, I have one Logger per class. I could configure 3
SyslogAppenders and tie each to a Logger just below rootLogger, but then
each class would have to know about 3 Loggers!

What's the best way to do this?

Many thanks in advance,
Pete

-- 
  Peter Munro
  pete@petermunro.org

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>