Karthik Krishnamurthy > Unix-Conf-Bind8-0.3 > Unix::Conf::Bind8::Conf::Logging::Channel

Download:
Unix-Conf-Bind8-0.3.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Unix::Conf::Bind8::Conf::Logging::Channel - Class implementing the channel subdirective of the logging directive

SYNOPSIS ^

    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'");

DESCRIPTION ^

new ()
 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.

delete ()
 Arguments

Object method. Deletes the invocant. Returns true on success, an Err object otherwise.

name ()
 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.

output ()
 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.

file ()
 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.

syslog ()
 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.
severity ()
 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.

print_time ()
 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.

print_category ()
 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-category' if defined, an Err object otherwise, if called without an argument.

print_severity ()
 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-severity' if defined, an Err object otherwise, if called without an argument.

delete_output ()
delete_severity ()
delete_print_time ()
delete_print_category ()
delete_print_severity ()

Deletes the relevant directives and returns true, if defined, an Err object otherwise.

categories ()

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.

syntax highlighting: