title: Log tomcat logs to rsyslog
body: <p>I have a java web application that runs with tomcat7 and logs with log4j. I want to send my logs to rsyslog. </p>
  
  <p>I have use the appeneder in my log4j.xml file. </p>
  
  <pre><code>&lt;appender name="syslog" class="org.apache.log4j.net.SyslogAppender"&gt;
            &lt;param name="Facility" value="USER"/&gt;
            &lt;param name="SyslogHost" value="localhost"/&gt;
        &lt;param name="Threshold" value="WARN"/&gt;
        &lt;layout class="org.apache.log4j.PatternLayout"&gt;
           &lt;param name="ConversionPattern" value="%d{MMM dd HH:mm:ss} MYAPP: %-5p %m%n"/&gt;
   &lt;/layout&gt;
  &lt;/appender&gt;
  </code></pre>
  
  <p>But I still don't see the logs that I've implemented in my java application in rsyslog. I can see them in catalina.out but not on rsyslog. </p>
  
  <p>Do I have to define new rules for rsyslog configuration? </p>
  
  <p>Thanks in advance. </p>
  
  <p>Updated log4j.xml : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
  &lt;log4j:configuration debug="true"
   xmlns:log4j='http://jakarta.apache.org/log4j/'&gt;
  
  
  &lt;appender name="System.out" class="org.apache.log4j.ConsoleAppender"&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
      &lt;param name="Target" value="System.out" /&gt;
      &lt;param name="ConversionPattern" 
        value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" /&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  
  &lt;appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender"&gt;
      &lt;param name="SyslogHost" value="localhost"/&gt;
      &lt;param name="Facility" value="LOCAL1"/&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
      &lt;param name="ConversionPattern" 
        value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" /&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  
  &lt;!-- for package specific --&gt; 
  &lt;!-- &lt;category name ="my.package" /&gt; --&gt;
  &lt;logger name ="Logger"&gt;
          &lt;level value ="debug" /&gt;
  &lt;/logger&gt;       
  
  &lt;!-- root logger --&gt; 
  &lt;root&gt;
       &lt;level value="info"/&gt;
        &lt;appender-ref ref="SYSLOG"/&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>    </p>