Skip Menu |

This queue is for tickets about the Log-Dispatch-FileRotate CPAN distribution.

Report information
The Basics
Id: 99343
Status: resolved
Priority: 0/
Queue: Log-Dispatch-FileRotate

People
Owner: Nobody in particular
Requestors: gerald.salin [...] toulouse.inra.fr
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: 1.19 - chmod 770 for newly created log diles
Date: Tue, 07 Oct 2014 10:44:28 +0200
To: bug-Log-Dispatch-FileRotate [...] rt.cpan.org
From: Gérald Salin <gerald.salin [...] toulouse.inra.fr>
Hi, I'm using Log::Dispatch::FileRotate for some weeks....thank you for this useful module. But I have a problem : the logfiles are used by web applications (with user apache) or by command lines application (another user, in the same group). When rotating (based on size), the current user is used as owner and the goup can't write to the newly created file, causing errors. Is there a simple way in your module to apply a chmod 770 to the created log files. Thank you for your help Gérald -- Gérald Salin Informatique - Plateforme GeT-PlaGe Génopole Toulouse Midi-Pyrénées Tél : 05.61.28.57.47 Fax : 05.61.28.55.93
On 2014-10-07 01:44:41, gerald.salin@toulouse.inra.fr wrote: Show quoted text
> Hi, > I'm using Log::Dispatch::FileRotate for some weeks....thank you for this > useful module. > But I have a problem : the logfiles are used by web applications (with > user apache) or by command lines application (another user, in the same > group). > When rotating (based on size), the current user is used as owner and the > goup can't write to the newly created file, causing errors. > > Is there a simple way in your module to apply a chmod 770 to the created > log files.
This plugin really ought to be respecting all options used by the parent class Log::Dispatch::File, of which 'permissions' is one. You might find that Log::Dispatch::File::Stamped works out better for you - instead of rotating files periodically, it simply logs directly to the file with the timestamp already in it (and does support all base Log::Dispatch::File options).
On Tue Oct 07 04:44:41 2014, gerald.salin@toulouse.inra.fr wrote: Show quoted text
> Is there a simple way in your module to apply a chmod 770 to the created > log files.
Hi. As someone else has already pointed out, the way to do this is to pass the "permissions" option to Log::Dispatch::FileRotate->new(). This will be passed up the chain to Log::Dispatch::File. See Log::Dispatch::File for details. I'm going to resolve this ticket as a result. -- Regards, Michael Schout