-
Notifications
You must be signed in to change notification settings - Fork 34
classes_essentials_logging_logger.class
Base class for logging. Do not use this directly but the functions in logging.php instead. Will ensure that logging information is writte to specified files. Will also take care of rotating the logs and cleaning up old logfiles.
Subclasses: CliLogger, TraceLogger
Adds a category
Definition: public function addCategory($name)
Returns: void
Parameters:
-
string $name
Category to add
SHORTCUT Logs to severity DEBUG
SHORTCUT Logs to severity ERROR
Extends the log filename.
Definition: public function extend($key, $value)
Returns: void
Parameters:
-
string $key
Key to use -
string $value
Value to use
SHORTCUT Logs to severity FATAL
Instanciates and return a Logger from a given config.
Definition: public static function Get($config)
Returns: mixed
The logger, may be of type Logger or whatever is specified in $config['class']
Parameters:
-
array $config
Logger configuration data
Checks for a category
Definition: public function hasCategory($name)
Returns: bool
Whether the category is set or not
Parameters:
-
string $name
Category to check for
SHORTCUT Logs to severity INFO
Removes a category
Definition: public function removeCategory($name)
Returns: void
Parameters:
-
string $name
Category to remove
Writes a LogReport to the log. See LogReport class and log_start_report/log_report for details.
Definition: public function report(LogReport $report, $severity, $log_trace=true)
Returns: void
Parameters:
-
LogReport $report
The report -
string $severity
Severity to use -
bool $log_trace
Append a trace (see debug_backtrace)
Forces log rotation.
Definition: public function RotateNow()
Returns: void
SHORTCUT Logs to severity TRACE
SHORTCUT Logs to severity WARN
Writes a log entry.
Definition: public function write($severity=false, $log_trace=false, $args)
Returns: void
Parameters:
-
string $severity
Severity -
bool $log_trace
If true appends a trace (see debug_backtrace). -
mixed $args
Data to be logged
Definition: protected function __construct($config)
Returns: NOT DOCUMENTED
Parameters:
-
$config
NOT DOCUMENTED