logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ole Ersoy <ole.er...@gmail.com>
Subject Using the SyslogAppender
Date Mon, 20 Oct 2008 04:06:29 GMT
Hi,

I'm attempting to setup an test for logging with syslog to /var/log/test.log. So far I have
this:

public class Log4JTest 
    extends TestCase
{
	Logger logger = Logger.getLogger(Log4JTest.class.getName());
	
	
	
	public void setUp()
	{

		SyslogAppender syslogAppender = new SyslogAppender();
		
		BasicConfigurator.configure();
		
		logger.addAppender(syslogAppender);
		
		syslogAppender.setSyslogHost("localhost");
		
		syslogAppender.setFacility("?????");
		
		syslogAppender.setLayout(new PatternLayout());

	}
    public void testApp()
    {
    	logger.info("I'm logging with syslog");
     }
}

Does anyone know what I need to pass to setFacility, and whether I need to make any adjustments
in /etc/rsyslog.conf for this to work?

Thanks,
- Ole





---------------------------------------------------------------------
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