When log4j initialization, it create log file will system defalut permission, such as "-rw-r--r--". But if other user use the application, he can't write any thing into log file. Log4j should add a property to set the permission of log file.
Any suggestions how that could be achieved in a reasonable manner. As far as I can tell, the Java runtime libraries provide no mechanism for specifying or modifying file permissions other than invoking a native method or executing a program.
To quote http://www.jguru.com/faq/view.jsp?EID=19558: "The proper way on Unix machines to do this is to set the userMask to the desired value. When JVM is run on Unix box it takes the file permissions from the value of userMask." This bug should be marked WONTFIX, since there's no way for log4j to set non-fileowner-permissions, except calling external programs. It's up to the host OS to setup these permissions. This should be mentioned in the documentation.