David Faizulaev created LOG4J2-1451:
---------------------------------------

             Summary: Java Log4j2 Syslog Appender
                 Key: LOG4J2-1451
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1451
             Project: Log4j 2
          Issue Type: Question
          Components: Appenders
    Affects Versions: 2.6.1
         Environment: Windows server 2012 64bit
Windows 7 64bit
            Reporter: David Faizulaev


I'm trying to use Log4j 2.6.1 in order to sent log messages via Syslog. I'm 
able to print them to file or console but I cannot seem to catch them in my 
Syslog server,or verify that they're even being sent.

I've activated Wireshark and it does not detect anything.
When I use Kiwi server to sent Syslog messages, they are sent, received and 
detected by Wireshark.
The Console Appender works just fine.

The Syslog server is located on the same machine.

*Here's my configuration file:*
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn" name="MyApp" packages="">
  <Appenders>
    <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} 
- %msg%n"/>
        </Console>
           <Syslog name="RFC5424" format="RFC5424" host="127.0.0.1" port="514"
            protocol="UDP" appName="MyApp" includeMDC="true"
            facility="LOCAL0" enterpriseNumber="18060" newLine="true"
            messageId="Audit" mdcId="mdc" id="App" ignoreExceptions="false">
        </Syslog>
          </Appenders>
  <Loggers>
    <Logger name="com.mycorp" level="info" />
        <Root level="info">
            <AppenderRef ref="RFC5424"/>
                        <AppenderRef ref="Console"/>
        </Root>
  </Loggers>
</Configuration>
{code}

*Java Class:*
{code:java}
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import java.io.*;
import java.sql.SQLException;
import org.apache.logging.log4j.core.net.*;

public class SyslogLogger
{
    private static final Logger LOG = LogManager.getLogger(SyslogLogger.class);

    public static void main (String[] args)throws IOException,SQLException
    {
        LOG.info("message log", "log message");
    }
}
{code}

Please advise what am I doing wrong?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to