title: Permissions on log files created by log4j RollingFileAppender
body: <p>How are the permissions for files created by <code>RollingFileAppender</code> determined?</p>
  
  <p>I recently changed a daemon process I have to be run as a non-root user and the files are now being created with permissions of <code>0600</code> (only readable by the owner), but I would like them to be readable by all or at least members of an admin group (<code>0644</code> or <code>0640</code>).  Files created by my tomcat apps are always <code>0644</code> (readable by all).</p>
  
  <p>I don't know if I inadvertently changed something else or if it is something to do with permissions of that user.  I made the parent directory <code>0777</code> as a test and it didn't seem to help (it was <code>0755</code>).  Obviously not a big deal since I can <code>sudo</code> to look at them, but rather annoying and it will be a problem if I have to have a customer copy them for me.</p>
  
  <p>Environment is Ubuntu 10.04LTS using <code>jsvc/commons-daemon</code> to run the daemon. In case it matters here is the basics on my <code>log4j</code> config:</p>
  
  <pre><code>&lt;!DOCTYPE log4j:configuration SYSTEM 'log4j.dtd'&gt;
  &lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"&gt;
  
  &lt;appender name="StdOutAppender" class="org.apache.log4j.ConsoleAppender"&gt;
      &lt;!-- only send error / fatal messages to console (catalina.out) --&gt;
      &lt;param name="threshold" value="${log4j.StdOutAppender.threshold}" /&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
          &lt;param name="ConversionPattern" value="%5p %d{ISO8601} [%t][%x] %c - %m%n" /&gt;
          &lt;!--%d{dd-MMM-yyyy HH:mm:ss.SSS} [%5p] %c{2}.%M [line:%L]: %m%n--&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  
  &lt;appender name="TimeBasedRollingFileAppender" class="org.apache.log4j.rolling.RollingFileAppender"&gt;
      &lt;param name="append" value="true" /&gt;
      &lt;param name="encoding" value="UTF-8" /&gt;
      &lt;param name="threshold" value="${log4j.TimeBasedRollingFileAppender.threshold}" /&gt;
      &lt;rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy"&gt;
          &lt;param name="FileNamePattern" value="${cloud.daemon.log4j.file.config.path}.%d.gz" /&gt;
      &lt;/rollingPolicy&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
          &lt;param name="ConversionPattern" value="%5p %d{ISO8601} [%t][%x] %c - %m%n" /&gt;
          &lt;!--%d{dd-MMM-yyyy HH:mm:ss.SSS} [%5p] %c{2}.%M [line:%L]: %m%n--&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  ....
  </code></pre>