Debian Codegraph @

README

raw
1 Log::Agent::Rotate 1.200
2
3 Copyright (c) 2000, Raphael Manfredi
4 Copyright (c) 2002-2015 Mark Rogaski;
5 [email protected]; all rights reserved.
6
7 ------------------------------------------------------------------------
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the Artistic License 2.0, a copy of which can
11 be found with perl.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 Artistic License 2.0 for more details.
17
18 http://www.perlfoundation.org/artistic_license_2_0
19
20 ------------------------------------------------------------------------
21
22 Name DSLI Description Info
23 ----------- ----- ------------------------------------------- -----
24 Log::Agent ----- A general logging framework MROGASKI
25 ::Rotate RdpO2 Logfile rotation config and support MROGASKI
26
27
28 The Log::Agent::Rotate module is an extension of Log::Agent that brings
29 file-rotating features to the File logging driver.
30
31 It is separated from Log::Agent itself because it has dependencies
32 on LockFile::Simple and Compress::Zlib that Log::Agent cannot have:
33 everyone with a plain stock Perl distribution must be able to simply
34 install Log::Agent and start using it.
35
36 This is NOT a generic all-purpose logfile rotation package. It is meant
37 to be used only within the Log::Agent framework.
38
39 SYNOPSIS
40
41 use Log::Agent;
42 require Log::Agent::Driver::File;
43 require Log::Agent::Rotate;
44
45 (my $me = $0) =~ s|.*/(.*)|$1|;
46
47 my $rotate = Log::Agent::Rotate->make(
48 -backlog => 7, # keep last seven logs + current
49 -unzipped => 2, # don't compress last archived 2 logs
50 -is_alone => 1, # programmer says only ONE process will run
51 -max_size => 100_000, # file will rotate when bigger than 100K
52 );
53
54 my $driver = Log::Agent::Driver::File->make(
55 -prefix => $me,
56 -showpid => 1,
57 -rotate => $rotate, # default rotation policy
58 -channels => {
59 'error' => '/tmp/output.err',
60 'output' => ['log.out', $rotate], # could have special policy
61 'debug' => '../appli.debug',
62 },
63 );
64 logconfig(-driver => $driver, -level => 'notice');
65
66 DESCRIPTION
67
68 Log::Agent::Rotate lets you specify the logfile rotation policy that will
69 be used on the logfiles managed via a Log::Agent::Driver::File driver.
70
71 It can be useful for daemon process to periodically rotate the logfiles
72 whilst keeping some fair amount of backlog. But it can also be used by
73 programs that run a short period of time and generate systematic logging,
74 that would end-up eating all the disk space if not monitored.
75
76 Please read the Log::Agent::Rotate(3) manpage and the related pages for more
77 information.