logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hut Carspecken <hutcarspec...@yahoo.com>
Subject Trouble with SyslogAppender and Writing to SysLogs
Date Wed, 09 Jun 2004 14:03:36 GMT
Good Morning,

In my log4j.properties file, I am writing to three Appenders: console, file, and syslog. 
I have
no trouble writing to the console and file.  However, I can not make the SyslogAppender write
to
the choosen facility. Below is the content of my properties file.

# Set root category priority to INFO and its only appender to CONSOLE.
#log4j.rootCategory=INFO, CONSOLE
log4j.rootCategory=DEBUG, CONSOLE, LOGFILE, SYSLOGFILE

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-5p %x - %m%n

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=/New.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.Threshold=INFO
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-5p %x - %m%n

# SYSLOG is set to be a Syslog appender using a Pattern Layout
log4j.appender.SYSLOGFILE=org.apache.log4j.net.SyslogAppender 
#log4j.appender.SYSLOGFILE.facility=local7
#log4j.appender.SYSLOGFILE.syslogName=MyLog
#log4j.appender.SYSLOGFILE.portNumber=-1
#log4j.appender.SYSLOGFILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-5p %x -
%m%n
log4j.appender.SYSLOGFILE.SyslogHost=localhost
log4j.appender.SYSLOGFILE.Threshold=DEBUG 
log4j.appender.SYSLOGFILE.Facility=USER 
log4j.appender.SYSLOGFILE.layout=org.apache.log4j.PatternLayout 
log4j.appender.SYSLOGFILE.layout.ConversionPattern=%d [%t] %p %c - %m %n 

As you can see, I using the USER facility.  I can set up the facility to point to a particular
file, but I have no luck writing to that file.

Any thoughts or comments?  Are there any glaring bad mistakes I made when seting up the
SyslogAppender?  Anything left out?

Many Thanks,

Hut

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


Mime
View raw message