Search code examples
unixlog4jweblogic12csyslog

Weblogic 12C sending logs to syslog


I want to send my weblogic log to syslog. here is what I have done so far.

1.Included following log4j.properties in managed server classpath -

log4j.rootLogger=DEBUG,syslog

log4j.appender.syslog=org.apache.log4j.net.SyslogAppender
log4j.appender.syslog.Threshold=DEBUG
log4j.appender.syslog.Facility=LOCAL7
log4j.appender.syslog.FacilityPrinting=false
log4j.appender.syslog.Header=true
log4j.appender.syslog.SyslogHost=localhost
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
log4j.appender.syslog.layout.ConversionPattern=[%p] %c:%L - %m%n 

2. added following command to managed server arguments -

-Dlog4j.configuration=file :<path to log4j properties file> -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dweblogic.log.Log4jLoggingEnabled=true 

3. Added wllog4j.jar and llog4j-1.2.14.jar into domain's lib folder.

4.Then, from Admin console changed logging information by doing the following. "my_domain_name"--->Configuration--->Logging--->(Advanced options)-->Logging implementation: Log4J

Restart managed server.

I used this as refernce. But didnt get anaything in syslog(/var/log/message). What am I doing wrong?


Solution

  • I figured out the problem. My appender was working fine, the problem was in rsyslog.conf. Just uncommented following properties

    # Provides UDP syslog reception
    #$ModLoad imudp
    #$UDPServerRun 514
    

    We were appending the messages, but the listner was abesnt, so it didnt knew what to do with it.

    and from *.debug;mail.none;authpriv.none;cron.none /var/log/messages it figures out where to redirect any (debug in this case) information to messages file.