Steven Haryanto > Log-Dispatch-Dir-0.12 > Log::Dispatch::Dir

Download:
Log-Dispatch-Dir-0.12.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.12   Source  

NAME ^

Log::Dispatch::Dir - Log messages to separate files in a directory, with rotate options

VERSION ^

This document describes version 0.12 of Log::Dispatch::Dir (from Perl distribution Log-Dispatch-Dir), released on 2014-05-17.

SYNOPSIS ^

    use Log::Dispatch::Dir;

    my $dir = Log::Dispatch::Dir->new(
        name => 'dir1',
        min_level => 'info',
        dirname => 'somedir.log',
        filename_pattern => '%Y-%m-%d-%H%M%S.%{ext}',
    );
    $dir->log( level => 'info', message => 'your comment\n" );

    # limit total size
    my $dir = Log::Dispatch::Dir->new(
        # ...
        max_size => 10*1024*1024, # 10MB
    );

    # limit number of files
    my $dir = Log::Dispatch::Dir->new(
        # ...
        max_files => 1000,
    );

    # limit oldest file
    my $dir = Log::Dispatch::Dir->new(
        # ...
        max_age => 10*24*3600, # 10 days
    );

DESCRIPTION ^

This module provides a simple object for logging to directories under the Log::Dispatch::* system, and automatically rotating them according to different constraints. Each message will be logged to a separate file the directory.

Logging to separate files can be useful for example when dumping whole network responses (like HTTP::Response content).

METHODS ^

new(%p)

This method takes a hash of parameters. The following options are valid:

log_message(message => $)

Sends a message to the appropriate output. Generally this shouldn't be called directly but should be called through the log() method (in Log::Dispatch::Output).

SEE ALSO ^

Log::Dispatch

HOMEPAGE ^

Please visit the project's homepage at https://metacpan.org/release/Log-Dispatch-Dir.

SOURCE ^

Source repository is at https://github.com/sharyanto/perl-Log-Dispatch-Dir.

BUGS ^

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Log-Dispatch-Dir

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR ^

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2014 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: