1rolllog(3)            User Contributed Perl Documentation           rolllog(3)
2
3
4

NAME

6       Net::DNS::SEC::Tools::rolllog - DNSSEC-Tools rollover logging
7       interfaces.
8

SYNOPSIS

10         use Net::DNS::SEC::Tools::rolllog;
11
12         @levels = rolllog_levels();
13
14         $curlevel = rolllog_level();
15         $oldlevel = rolllog_level("info");
16         $oldlevel = rolllog_level(LOG_ERR,1);
17
18         $curlogfile = rolllog_file();
19         $oldlogfile = rolllog_file("-");
20         $oldlogfile = rolllog_file("/var/log/roll.log",1);
21
22         $loglevelstr = rolllog_str(8)
23         $loglevelstr = rolllog_str("info")
24
25         $ret = rolllog_num("info");
26
27         $bool = rolllog_validlevel($newlevel);
28         $bool = rolllog_validlevel(8);
29
30         $curtz = rolllog_gettz();
31         $oldtz = rolllog_settz('local');
32
33         rolllog_log(LOG_INFO,"example.com","zone is valid");
34

DESCRIPTION

36       The Net::DNS::SEC::Tools::rolllog module provides logging interfaces
37       for the rollover programs.  The logging interfaces allow log messages
38       to be recorded.  rollerd must be running, as it is responsible for
39       updating the log file.
40
41       Each log message is assigned a particular logging level.  The valid
42       logging levels are:
43
44           text       numeric  meaning
45           ----       -------  -------
46           tmi           1     The highest level -- all log messages
47                               are saved.
48           expire        3     A verbose countdown of zone expiration
49                               is given.
50           info          4     Many informational messages are recorded.
51           phase         6     Each zone's current rollover phase
52                               is given.
53           err           8     Errors are recorded.
54           fatal         9     Fatal errors are saved.
55
56       The levels include all numerically higher levels.  For example, if the
57       log level is set to phase, then err and fatal messages will also be
58       recorded.
59

LOGGING INTERFACES

61       rolllog_file(newfile,useflag)
62           This routine sets and retrieves the log file for rollerd.  The
63           newfile argument specifies the new log file to be set.  If newfile
64           exists, it must be a regular file.
65
66           The useflag argument is a boolean that indicates whether or not to
67           give a descriptive message if an invalid log file is given.  If
68           useflag is true, the message is given and the process exits; if
69           false, no message is given.  For any error condition, an empty
70           string is returned.
71
72       rolllog_gettz()
73           This routine returns the timezone selector currently in use.  This
74           value may be either 'gmt' (for Greenwich Mean Time) or 'local' (for
75           the host's local time.)
76
77       rolllog_level(newlevel,useflag)
78           This routine sets and retrieves the logging level for rollerd.  The
79           newlevel argument specifies the new logging level to be set.
80           newlevel may be given in either text or numeric form.
81
82           The useflag argument is a boolean that indicates whether or not to
83           give a descriptive message and exit if an invalid logging level is
84           given.  If useflag is true, the message is given and the process
85           exits; if false, -1 is returned.
86
87           If given with no arguments, the current logging level is returned.
88           In fact, the current level is always returned unless an error is
89           found.  -1 is returned on error.
90
91       rolllog_levels()
92           This routine returns an array holding the text forms of the user-
93           settable logging levels.  The levels are returned in order, from
94           most verbose to least.
95
96       rolllog_log(level,group,message)
97           The rolllog_log() interface writes a message to the log file.  Log
98           messages have this format:
99
100                   timestamp: group: message
101
102           The level argument is the message's logging level.  It will only be
103           written to the log file if the current log level is numerically
104           equal to or less than level.
105
106           group allows messages to be associated together.  It is currently
107           used by rollerd to group messages by the zone to which the message
108           applies.
109
110           The message argument is the log message itself.  Trailing newlines
111           are removed.
112
113       rolllog_num(loglevel)
114           This routine translates a text log level (given in loglevel) into
115           the associated numeric log level.  The numeric log level is
116           returned to the caller.
117
118           If loglevel is an invalid log level, -1 is returned.
119
120       rolllog_settz(tzsel)
121           This routine sets the timezone to be used for timestamps in
122           messages written to the log.  This tzsel value may be either 'gmt'
123           (Greenwich Mean Time) or 'local' (for the host's local time.)
124           tzsel may be uppercase or lowercase; the value will be converted to
125           lowercase.  If no value is passed, then the default will be used.
126
127           The current timezone selector is returned.  If an invalid selector
128           is given, then an undefined value is returned.
129
130       rolllog_str(loglevel)
131           This routine translates a log level (given in loglevel) into the
132           associated text log level.  The text log level is returned to the
133           caller.
134
135           If loglevel is a text string, it is checked to ensure it is a valid
136           log level.  Case is irrelevant when checking loglevel.
137
138           If loglevel is numeric, it is must be in the valid range of log
139           levels.  undef is returned if loglevel is invalid.
140
141       rolllog_validlevel(level)
142           This interface returns a boolean value indicating if the given
143           logging level is valid.
144
145           The level argument is the logging level to be validated.  It may be
146           a numeric or textual value.
147
149       Copyright 2005-2014 SPARTA, Inc.  All rights reserved.  See the COPYING
150       file included with the DNSSEC-Tools package for details.
151

AUTHOR

153       Wayne Morrison, tewok@tislabs.com
154

SEE ALSO

156       rollctl(1)
157
158       rollerd(8)
159
160       Net::DNS::SEC::Tools::rollmgr.pm(3)
161
162
163
164perl v5.36.0                      2023-01-19                        rolllog(3)
Impressum