logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44945] New: SyslogAppender not working
Date Tue, 06 May 2008 21:21:56 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44945

           Summary: SyslogAppender not working
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: smendenh@redhat.com


I've tried with the latest 1.2.14 and 1.2.15 and the SyslogAppender does not
appear to be working in either one.

/etc/syslog.conf contains LOCAL7.* /var/log/jboss.log

Java code:
[code]
public class Test {

        static Logger logger = Logger.getLogger(Test.class);

        public static void main(String[] args) {

                PatternLayout pattern = new PatternLayout();
                pattern.setConversionPattern("[%d{ABSOLUTE},%c{1}] %m%n");

                ConsoleAppender console = new ConsoleAppender();
                console.setName("CONSOLE");
                console.setLayout(pattern);
                console.setTarget(ConsoleAppender.SYSTEM_OUT);
                //console.setWriter();
                console.setThreshold(Priority.DEBUG);

                SyslogAppender syslog = new SyslogAppender();
                syslog.setName("SYSLOG");
                syslog.setSyslogHost("localhost");
                syslog.setFacility("LOCAL7");
                syslog.setFacilityPrinting(true);
                syslog.setLayout(pattern);

                console.activateOptions();
                syslog.activateOptions();

                logger.addAppender(console);
                logger.addAppender(syslog);

            logger.info("Test message.");
        }
}
[/code]

Messages are logged to the console as expected but nothing gets logged to the
syslog.

-Samuel
Internal ref: 176164


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message