houseabsolute / Log-Dispatch

Dispatches messages to one or more outputs
https://metacpan.org/release/Log-Dispatch/
Other
12 stars 29 forks source link

Log::Dispatch::File : add reopen() method #30

Open autarch opened 7 years ago

autarch commented 7 years ago

Migrated from rt.cpan.org #47513 (status was 'open')

Requestors:

From dolmen@cpan.org (@dolmen) on 2009-07-02 15:55:25:

Adding a reopen() method (that just closes/opens the file handle) would ease the implementation of log rotation using external tools such as logrotate.

The implementation in the Log::Dispatch::File class would benefit to all its subclasses such as Log::Dispatch::File::Rolling.

autarch commented 7 years ago

From drolsky@cpan.org (@autarch) on 2009-09-12 16:27:22:

On Thu Jul 02 11:55:25 2009, DOLMEN wrote:

Adding a reopen() method (that just closes/opens the file handle) would ease the implementation of log rotation using external tools such as logrotate.

The implementation in the Log::Dispatch::File class would benefit to all its subclasses such as Log::Dispatch::File::Rolling.

Did you mean to attach a patch to this?

autarch commented 7 years ago

From dolmen@cpan.org (@dolmen) on 2009-09-21 14:01:00:

Le Sam. Sep. 12 12:27:22 2009, DROLSKY a écrit :

Did you mean to attach a patch to this?

Here is an implementation:

sub reopen() { unless ($self->{close}) { close($self->{fh}) if exists $self->{fh}; $self->_open_file; } }

Doc and tests still have to be written :(