From: Kevin M. G. <cp...@go...> - 2007-02-24 17:29:12
|
You're right, there are a bunch of different solutions to the problem, varying in "neatness" according to taste. Here are a couple possibilities: Assuming you're in a unix-y environment and starting log4perl though a PerlRequire'd script, you could a) after Log4perl::init(), loop through the directory and fix up the permissions to what they should be b) something like this should work: #change effective uid while we open the log files { local $> = getpwnam('nobody'); #or whoever owns them Log::Log4perl::init() } On Feb 23, 2007, at 1:23 PM, John ORourke wrote: > Hi Martin, > > I can't help but I'll be watching for answers because I'm seeing a > possibly related problem when using FileRotate initialised from a > config > file called by Apache. > > I have a mod_perl app which is loaded during Apache startup (while > Apache is root) which calls init_and_watch. > If I have my FileRotate log going at startup, only the server startup > messages get written because the child processes run as 'apache' which > doesn't have permission to write to the file create by Apache while it > was root. > As a workaround I have it commented out in my log4perl config on > startup > then I un-comment it and init_and_watch catches the change and starts > writing. > > Obviously there are a few solutions but I've yet to choose a 'neat' > solution. > > John |