I should add that the very first log file is created with the non-root user as the owner and group and log messages are successfully written to it. It is the rolling over of the log file that has a permission problem.
Alex ________________________________________ From: Alex Huang (Gorilla) [alexhu...@gorilla-technology.com] Sent: Sunday, May 15, 2011 8:29 AM To: log4cxx-user@logging.apache.org Subject: RollingFileAppender file permission problem Hello, I am using apache-log4cxx-0.10.0 in an application that is run as a service on CentOS 5.5. The service's init.d file runs the application using the daemon function from /etc/init.d/functions. I pass the --user option so that the service runs as a non-root user. The problem is that when the RollingFileAppender rolls over the log file, the new log file ends up with root as the owner and group instead of the non-root user as owner and group. This results in a permission problem as the application cannot write to the new log file. Other files created by my application have the non-root user as owner and group. I have browsed the source, but do not see an obvious reason for this behavior. If anyone has insight into this problem, please let me know. Thank you, Alex