Syslog stream for Logging. Writes logs to the system logger
$_defaults
protected array
By default messages are formatted as: type: message
$_open
protected boolean
$_priorityMap
protected array
Make sure the configuration contains the format parameter, by default it uses the error number and the type as a prefix to the message
Extracts the call to openlog() in order to run unit tests on it. This function will initialize the connection to the system logger
Extracts the call to syslog() in order to run unit tests on it. This function will perform the actual write in the system logger
__construct( array $config array() )
Make sure the configuration contains the format parameter, by default it uses the error number and the type as a prefix to the message
$config
optional array() BaseLog::__construct()
_open( string $ident , integer $options , integer $facility )
Extracts the call to openlog() in order to run unit tests on it. This function will initialize the connection to the system logger
$ident
$options
$facility
_write( integer $priority , string $message )
Extracts the call to syslog() in order to run unit tests on it. This function will perform the actual write in the system logger
$priority
$message
write( string $type , string $message )
Writes a message to syslog
Map the $type back to a LOG_ constant value, split multi-line messages into multiple log messages, pass all messages through the format defined in the configuration
$type
$message
config( array $config array() )
Sets instance config. When $config is null, returns config array
Config
types
string or array, levels the engine is interested inscopes
string or array, scopes the engine is interested in$config
optional array() protected array
By default messages are formatted as: type: message
To override the log format (e.g. to add your own info) define the format key when configuring this logger
If you wish to include a prefix to all messages, for instance to identify the application or the web server, then use the prefix option. Please keep in mind the prefix is shared by all streams using syslog, as it is dependent of the running process. For a local prefix, to be used only by one stream, you can use the format key.
CakeLog::config('error', array( 'engine' => 'Syslog', 'types' => array('emergency', 'alert', 'critical', 'error'), 'format' => "%s: My-App - %s", 'prefix' => 'Web Server 01' ));
array( 'format' => '%s: %s', 'flag' => LOG_ODELAY, 'prefix' => '', 'facility' => LOG_USER )
protected array
Used to map the string names back to their LOG_* constants
array( 'emergency' => LOG_EMERG, 'alert' => LOG_ALERT, 'critical' => LOG_CRIT, 'error' => LOG_ERR, 'warning' => LOG_WARNING, 'notice' => LOG_NOTICE, 'info' => LOG_INFO, 'debug' => LOG_DEBUG )
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/2.9/class-SyslogLog.html