File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Help log4j SysLogAppender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help log4j SysLogAppender " Watch "Help log4j SysLogAppender " New topic

Help log4j SysLogAppender

arthik babu

Joined: Mar 06, 2007
Posts: 10

I am not able to write the log messages in the syslog server (particularly I need to write in the messages log file) and Pls find the code below and I dont know wht missed out

package com.test.syslog;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class TestSyslog {

static Logger log = Logger.getLogger("TestSyslog");

public static void main(String args[]) {
log.debug("This is my debug message.");"This is my info message.");
log.warn("This is my warn message.");
log.error("This is my error message.");
log.fatal("This is my fatal message.");

config file

log4j.rootLogger=INFO, A1
log4j.appender.A1.layout.ConversionPattern=%-4r %-5p %c{2} %M.%L %x - %m\n

Thanks in advance
I agree. Here's the link:
subject: Help log4j SysLogAppender
It's not a secret anymore!