spunQ_SyslogLogTarget Class Reference

A LogTarget that prints messages to the system's logging facility. More...

Inheritance diagram for spunQ_SyslogLogTarget:

spunQ_LogTarget spunQ_ILogTarget

List of all members.

Public Member Functions

 __construct ()
 Constructor.
 logMessage ($path, $priority, $message, $file, $line)
 This function will be called by the logging facility.
 logMessageSimple ($message, $priority= 'LOG_INFO')
 Just write a message in syslog respecting the given priority.

Static Public Member Functions

static getInstance ()
 The singleton getter.
static spunQToSyslogLevel ($spunQLevel)
 Returns the correct LOG_* constant for a spunQ log level.
static syslogLevelString ($syslogLevel)
 Outputs the name of the constant for a syslog log level (LOG_* constant).
static spunQToSyslogLevelString ($spunQLevel)
 Short-hand for syslogLevelString(spunQToSyslogLevel()).
static convertObjectToString ($object, $indent=0, $visited=array(), $verbose=true)
 Converts an object to a string value.

Static Private Attributes

static $instance
 The singleton instance of this class.


Detailed Description

A LogTarget that prints messages to the system's logging facility.

Available system log levels as described by the php manual:

Since these levels refer to the complete system's stability, we'll not log above LOG_CRIT. The complete mapping goes like this:
See also:
http://php.net/syslog

Definition at line 25 of file SyslogLogTarget.class.php.


Member Function Documentation

static spunQ_LogTarget::convertObjectToString ( object,
indent = 0,
visited = array(),
verbose = true 
) [static, inherited]

Converts an object to a string value.

Parameters:
$object The object to convert.
$indent Indentation level of the hierarchy
$visited array of processed objects. Tracked to detect recursion.
Returns:
string

Definition at line 15 of file LogTarget.class.php.

static spunQ_SyslogLogTarget::getInstance (  )  [static]

The singleton getter.

Returns:
spunQ_SyslogLogTarget

Definition at line 37 of file SyslogLogTarget.class.php.

spunQ_SyslogLogTarget::logMessage ( path,
priority,
message,
file,
line 
)

This function will be called by the logging facility.

A logger rule matched a logging event that was triggered and this log target was provided to the rule.

See also:
spunQ_Logger
Parameters:
$path The source of the log event.
$priority The priority with which the Logger was invoked.
$message The message of the log event.
$file The path to the file where the event actually occured.
$line The line within the file where the log event was triggered
Returns:
spunQ_ILogTarget $this

Implements spunQ_ILogTarget.

Definition at line 103 of file SyslogLogTarget.class.php.

static spunQ_SyslogLogTarget::spunQToSyslogLevel ( spunQLevel  )  [static]

Returns the correct LOG_* constant for a spunQ log level.

Parameters:
$spunQLevel One of the level constants in spunQ_Logger.
Returns:
The matching LOG_* constant defined in the Network package of PHP.

Definition at line 50 of file SyslogLogTarget.class.php.

static spunQ_SyslogLogTarget::spunQToSyslogLevelString ( spunQLevel  )  [static]

Short-hand for syslogLevelString(spunQToSyslogLevel()).

See also:
spunQToSyslogLevel()

syslogLevelString()

Parameters:
$spunQLevel One of the level constants in spunQ_Logger.
Returns:
string

Definition at line 88 of file SyslogLogTarget.class.php.

static spunQ_SyslogLogTarget::syslogLevelString ( syslogLevel  )  [static]

Outputs the name of the constant for a syslog log level (LOG_* constant).

Parameters:
$syslogLevel One of the LOG_* constants defined in the Network package of PHP.
Returns:
string Will return UNDEFINED for unrecognized values.

Definition at line 71 of file SyslogLogTarget.class.php.


Member Data Documentation

spunQ_SyslogLogTarget::$instance [static, private]

The singleton instance of this class.

Type:
spunQ_SyslogLogTarget

Definition at line 31 of file SyslogLogTarget.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:44 2011 for spunQ3 by  doxygen 1.5.9