logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berwanger, Christian" <christian.berwan...@logica.com>
Subject RE: Using the SyslogAppender
Date Mon, 20 Oct 2008 09:44:53 GMT
Hi Ole,

You have to pass there one of the following listed strings depending
which category you want to log the message 

 "LOCAL0" 
 "LOCAL1" 
 "LOCAL2" 
 "LOCAL3" 
 "LOCAL4" 
 "LOCAL5" 
 "LOCAL6" 
 "LOCAL7" 

You could later configure filters in order to store messages with the
same facility id in one folder.

Please confirm as well that the syslog port is open for the local
machine otherwise you will not receive messages on the local machine.

Does it work?

Christian 


-----Original Message-----
From: Ole Ersoy [mailto:ole.ersoy@gmail.com] 
Sent: 20 October 2008 06:06
To: log4j-user@logging.apache.org
Subject: Using the SyslogAppender

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



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It
may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.



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