NAME
WWW::MLite::Log - CTK Logging methods
VERSION
Version 1.00
SYNOPSIS
$config->set(debug => 0); # 0 - off / 1 - on
$config->set(loglevel => 'emerg'); # or '7'
$config->set(logfile => 'test.log'); # File name. Optional. Default - undef
$config->set(syslog => 0); 0 - off / 1 - on (Apache log file)
$mlite->debug( " ... Blah-Blah-Blah ... ", $verbose, $file );
$mlite->log( " ... Blah-Blah-Blah ... ", "info", $file, $separator );
$mlite->syslog( " ... Blah-Blah-Blah ... ", $level );
$mlite->exception( " ... Blah-Blah-Blah ... " );
$mlite->log_except(); # 9 exception
$mlite->log_fatal(); # 8 fatal
$mlite->log_emerg(); # 7 system is unusable
$mlite->log_alert(); # 6 action must be taken immediately
$mlite->log_crit(); # 5 critical conditions
$mlite->log_error(); # 4 error conditions
$mlite->log_warning(); # 3 warning conditions
$mlite->log_notice(); # 2 normal but significant condition
$mlite->log_info(); # 1 informational
$mlite->log_debug(); # 0 debug-level messages (default)
DESCRIPTION
All of methods are returned by log-records
- exception
-
my $excstat = $mlite->exception( $message );
Write exception information to file
- debug
-
my $debugstat = $mlite->debug( $message, $verbose, $file );
Write debugging information to logfile
$message - Log (debug) message $verbose - System information flag. 1 - verbose mode, on / 0 - regular mode, off $file - Log file (absolute). Default - STDOUT (Apache logging). If the flag syslog the value is ignored - the message is written to the Apache logfile.
It should be noted that if the flag is omitted then the output information debug be ignored.
- log
-
my $logstat = $mlite->log( $message, $level, $file, $separator );
Main logging method
$message - Log message $level - logging level. It may be either a numeric or string value of the form: debug -- 0 (default) info -- 1 notice -- 2 warning -- 3 error -- 4 crit -- 5 alert -- 6 emerg -- 7 fatal -- 8 except -- 9 $file - Log File (absolute). Default - STDOUT (Apache logging). If the flag syslog the value is ignored - the message is written to the Apache logfile $separator - Log-record separator char's string. Default as char(32): ' '
- log_debug
-
Alias for call: $mlite->log( $message, 'debug' )
- log_info
-
Alias for call: $mlite->log( $message, 'info' )
- log_notice
-
Alias for call: $mlite->log( $message, 'notice' )
- log_warning
-
Alias for call: $mlite->log( $message, 'warning' )
- log_warn
-
Alias for call: $mlite->log( $message, 'warning' )
- log_error
-
Alias for call: $mlite->log( $message, 'error' )
- log_err
-
Alias for call: $mlite->log( $message, 'error' )
- log_crit
-
Alias for call: $mlite->log( $message, 'crit' )
- log_alert
-
Alias for call: $mlite->log( $message, 'alert' )
- log_emerg
-
Alias for call: $mlite->log( $message, 'emerg' )
- log_fatal
-
Alias for call: $mlite->log( $message, 'fatal' )
- log_except
-
Alias for call: $mlite->log( $message, 'except' )
- log_exception
-
Alias for call: $mlite->log( $message, 'except' )
- syslog, logsys
-
my $logstat = $mlite->syslog( $message, $level );
Apache logging to the Apache logfile (ErrorLog of your virtualhost)
$level can take the following values:
debug, info, notice, warning, error, crit, alert, emerg, fatal, except
The function returns work status
HISTORY
See CHANGES
file
AUTHOR
Serz Minus (Lepenkov Sergey) http://www.serzik.com <minus@mail333.com>
COPYRIGHT
Copyright (C) 1998-2014 D&D Corporation. All Rights Reserved
LICENSE
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
See LICENSE
file