syslog4j

%HOSTNAME% value is “unknown” in rsyslog

别说谁变了你拦得住时间么 提交于 2020-01-16 13:12:13
问题 The Gist Where does rsyslog get the value of %HOSTNAME%? Why does an application served by Tomcat have the correct %HOSTNAME%, but a console application with the same configuration has "unknown" as the hostname? We're using rsyslog on an EC2 instance and we're trying to send our logs out to loggly. If I tail -f the log messages, I can see the log in the default format including date, hostname, tag, and message. If I use logger "message" then I see a correct log entry both in the console and

Using Syslog's unix socket with Log4J2

情到浓时终转凉″ 提交于 2019-12-05 20:31:20
问题 I would like to send the logs of an application on a rsyslog server using the client protocol : Unix socket. Both application and rsyslog server are on the same machine. I've been comparing different logging tools : Log4J, Logback and Log4J2. Log4J's Syslog appender doesn't permit it natively. A solution is to use Syslog4J and configure our Syslog4JAppender this way : <appender name="mySyslogAppender" class="org.productivity.java.syslog4j.impl.log4j.Syslog4jAppender"> <param name="protocol"