Unix::Conf::Bind8::Conf::Logging::Channel - Class implementing the channel subdirective of the logging directive
use Unix::Conf::Bind8; my ($conf, $channel, $ret); $conf = Unix::Conf::Bind8->new_conf ( FILE => '/etc/named.conf', SECURE_OPEN => 1, ) or $conf->die ("couldn't open `named.conf'"); # get an existing logging object $channel = $conf->get_logging ()->get_channel ('some_channel') or $channel->die ("couldn't get channel `some_channel'"); # assuming previous output was syslog change output to file # and set severity to debug at level 3 $ret = $channel->output ('file') or $ret->die ("couldn't set output to `file'"); $ret = $channel->file ('my.log') or $ret->die ("couldn't set file to `my.log'"); $ret = $channel->severity ( { NAME => 'debug', LEVEL => 3 } ) or $ret->die ("couldn't set severity"); # also enable print-severity $ret = $channel->print_severity ('yes') or $ret->die ("couldn't enable `print-severity'"); # and delete the `print-category' channel directive # not delete is not the same as disabling by setting # print-severity to no $ret = $channel->delete_print_severity () or $ret->die ("couldn't delete `print-severity'");
Arguments PARENT => ref to a Unix::Conf::Bind8::Conf::Logging object NAME => 'channel-name', OUTPUT => 'value', # syslog|file|null FILE => { PATH => 'file-name', # only if OUTPUT eq 'file' VERSIONS => value, # 'unlimited' | NUMBER SIZE => value, # 'unlimited' | 'default' | NUMBER } SYSLOG => 'facility-name',# only if OUTPUT eq 'syslog' SEVERITY => 'severity-name', 'PRINT-TIME' => 'value', # yes|no 'PRINT-SEVERITY' => 'value', # yes|no 'PRINT-CATEGORY' => 'value', # yes|no
Class constructor Creates a new Unix::Conf::Bind8::Logging::Channel object, initializes it and returns it on success, or an Err object on failure.
Arguments
Object method. Deletes the invocant. Returns true on success, an Err object otherwise.
Arguments 'CHANNEL-NAME',
Object method Get/Set name attribute for the invoking object. If called with an argument, sets channel name and returns true on success, an Err object otherwise. Returns channel name if invoked without an argument.
Arguments 'OUTPUT', # syslog|file|null
Object method. Get/set attributes for the invoking object. If called with an argument, tries to set the output to argument and returns true if successful, an Err object otherwise. Returns the currently set output if set, an Err object otherwise if called without an argument.
Arguments PATH => 'path_name', VERSIONS => versions_allowed, # 'unlimited' | NUMBER SIZE => size_spec, # 'unlimited' | 'default' | NUMBER
Object method. Get/set file attributes for the invoking object. If argument is passed, the method tries to set the file parameters and returns true if successful, an Err object otherwise. Returns a hash ref containing information in the same format as the argument, if defined, an Err object otherwise, if called without an argument.
Arguments facility, # kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron # |authpriv|ftp|local0|local1|local2|local3|local4|local5 # local6|local7 Object method. Get/Set the syslog attribute of the invoking channel object. If called with an argument, the method tries to set the facility and returns true if successful, an Err object otherwise. Returns defined facility if called without an argument, an Err object otherwise.
Arguments NAME => severity, # critical|error|warning|notice|info # |debug|dynamic LEVEL => number, # debug level. to be specified only if # severity is debug.
Object method Get/Set the severity attribute of the invoking object. If argument is specified the method tries to set the severity and returns true on success, an Err object on failure. Returns defined severity if called without an argument, an Err object otherwise.
Arguments yes_no,
Object method. Get/Set attribute of the invoking Channel object. If argument is passed, this method tries to set the value and returns true on success, an Err object on failure. Returns defined value of 'print-time' if defined, an Err object otherwise, if called without an argument.
Object method. Get/Set attribute of the invoking Channel object. If argument is passed, this method tries to set the value and returns true on success, an Err object on failure. Returns defined value of 'print-category' if defined, an Err object otherwise, if called without an argument.
Object method. Get/Set attribute of the invoking Channel object. If argument is passed, this method tries to set the value and returns true on success, an Err object on failure. Returns defined value of 'print-severity' if defined, an Err object otherwise, if called without an argument.
Deletes the relevant directives and returns true, if defined, an Err object otherwise.
Object method. Returns the categories that have defined this channel. In scalar context returns the number of categories, returns a list of category names in list context.
3 POD Errors
The following errors were encountered while parsing the POD:
=over without closing =back
=cut found outside a pod block. Skipping to next block.
To install Unix::Conf::Bind8, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Unix::Conf::Bind8
CPAN shell
perl -MCPAN -e shell install Unix::Conf::Bind8
For more information on module installation, please visit the detailed CPAN module installation guide.