File: README

package info (click to toggle)
liblog-dispatch-filewriterotate-perl 0.062-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 148 kB
  • sloc: perl: 72; makefile: 2
file content (86 lines) | stat: -rw-r--r-- 2,607 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
NAME
    Log::Dispatch::FileWriteRotate - Log to files that archive/rotate
    themselves, w/ File::Write::Rotate

VERSION
    This document describes version 0.062 of Log::Dispatch::FileWriteRotate
    (from Perl distribution Log-Dispatch-FileWriteRotate), released on
    2021-07-21.

SYNOPSIS
     use Log::Dispatch::FileWriteRotate;

     my $file = Log::Dispatch::FileWriteRotate(
         min_level => 'info',

         # will be passed to File::Write::Rotate
         dir       => '/var/log',
         prefix    => 'myapp',
         suffix    => '.log',
         period    => 'monthly',
         size      => 25*1024*1024,
         histories => 12,
     );

     $file->log(level => 'info', message => "Your comment\n");

DESCRIPTION
    This module functions similarly to Log::Dispatch::FileRotate, but uses
    File::Write::Rotate as backend, thus interoperates more easily with
    other modules which use File::Write::Rotate as backend, e.g.
    Tie::Handle::FileWriteRotate or Process::Govern.

CONTRIBUTOR
    Steven Haryanto <sharyanto@cpan.org>

METHODS
  new(%args)
    Constructor. This method takes a hash of parameters. The following
    options are valid: "min_level" and "max_level" (see Log::Dispatch
    documentation); "dir", "prefix", "suffix", "period", "size", and
    "histories" (see File::Write::Rotate).

  log_message(message => STR)
    Send a message to the appropriate output. Generally this shouldn't be
    called directly but should be called through the "log()" method (in
    LLog::Dispatch::Output>).

  fwr
    Expose File::Write::Rotate object. You can do access this object e.g. to
    compress logfiles:

     $file->fwd->compress;

HOMEPAGE
    Please visit the project's homepage at
    <https://metacpan.org/release/Log-Dispatch-FileWriteRotate>.

SOURCE
    Source repository is at
    <https://github.com/perlancar/perl-Log-Dispatch-FileWriteRotate>.

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

    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.

SEE ALSO
    Log::Dispatch

    File::Write::Rotate

    Log::Dispatch::FileRotate

AUTHOR
    perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE
    This software is copyright (c) 2021, 2019, 2015, 2013, 2012 by
    perlancar@cpan.org.

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