title: Log4j on Linux server
body: <p>I have Linux server on which I run tomcat with my axis2 webservice.</p>
  
  <p>I use the following for Log4j:
  xml configuration file, which is located in the same directory as my webservice java file.</p>
  
  <p>XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE log4j:configuration PUBLIC "-//LOGGER" "log4j.dtd"&gt;
  
  &lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt;
  
      &lt;!-- Appenders --&gt;
      &lt;appender name="roll" class="org.apache.log4j.rolling.RollingFileAppender"&gt;
          &lt;param name="file" value="~//..//tmp//CookTalesLog.log" /&gt;
                  &lt;param name="append" value="true" /&gt;
                  &lt;param name="encoding" value="UTF-8" /&gt;
                  &lt;rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy"&gt;
                          &lt;!-- The file to roll to, this is a fairly intelligent parameter, if the file
                          ends in .gz, it gzips it, based on the date stamp it rolls at that time, 
                          default is yyyy-MM-dd, (rolls at midnight)
                          See: http://logging.apache.org/log4j/companions/extras/apidocs/org/apache/log4j/rolling/TimeBasedRollingPolicy.html --&gt;
                          &lt;param name="FileNamePattern" value="CookTalesLog.%d.log.gz" /&gt;
                  &lt;/rollingPolicy&gt;
  
                  &lt;layout class="org.apache.log4j.PatternLayout"&gt;
                          &lt;!-- The log message pattern --&gt;
                          &lt;param name="ConversionPattern" value="%5p %d{ISO8601} [%t][%x] %c - %m%n" /&gt;
                  &lt;/layout&gt;
      &lt;/appender&gt;
  
      &lt;root&gt;
          &lt;priority value="debug" /&gt;
          &lt;appender-ref ref="roll" /&gt;
      &lt;/root&gt;
  
  &lt;/log4j:configuration&gt;
  </code></pre>
  
  <p>In the java code:
  I tried to use each of the following lines</p>
  
  <pre><code>private static final Logger sLogObj = Logger.getLogger( ICDBWebService.class );
  
  private static final Log sLogObj = LogFactory.getLog(ICDBWebService.class);
  </code></pre>
  
  <p>also used:</p>
  
  <pre><code>static
  {
      DOMConfigurator.configure( "log4j.xml" );
  }
  </code></pre>
  
  <p>For logging:</p>
  
  <pre><code>    sLogObj.debug( "Login: email=" + email + " pwd= " + password );
  </code></pre>
  
  <p>Log file is not created....</p>
  
  <p>Any ideas what am I doing wrong?</p>