logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Goers (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1451) Java Log4j2 Syslog Appender
Date Thu, 30 Jun 2016 05:07:10 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15356527#comment-15356527
] 

Ralph Goers commented on LOG4J2-1451:
-------------------------------------

Gary, shouldn't we at least verify that this isn't a bug in Log4j before marking it invalid?
 Do we have a syslog test that uses UDP?

> 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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message