\Monolog\HandlerSyslogHandler

Logs to syslog service.

usage example:

$log = new Logger('application'); $syslog = new SyslogHandler('myfacility', 'local6'); $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%"); $syslog->setFormatter($formatter); $log->pushHandler($syslog);

Summary

Methods
Properties
Constants
__construct()
handle()
reset()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
isHandling()
setLevel()
getLevel()
setBubble()
getBubble()
handleBatch()
close()
__destruct()
__sleep()
No public properties found
No constants found
getDefaultFormatter()
write()
processRecord()
resetProcessors()
$facility
$logLevels
$facilities
$processors
$formatter
$level
$bubble
$ident
$logopts
N/A
No private methods found
No private properties found
N/A

Properties

$facility

$facility : 

Type

$logLevels

$logLevels : 

Translates Monolog log levels to syslog log priorities.

Type

$facilities

$facilities : 

List of valid log facility names.

Type

$processors

$processors : array<mixed,callable>

Type

array<mixed,callable>

$formatter

$formatter : \Monolog\Handler\?FormatterInterface

Type

\Monolog\Handler\?FormatterInterface

$level

$level : 

Type

$bubble

$bubble : 

Type

$ident

$ident : 

Type

$logopts

$logopts : 

Type

Methods

__construct()

__construct(string  $ident, string|integer  $facility = LOG_USER, string|integer  $level = \Monolog\Logger::DEBUG, boolean  $bubble = true, integer  $logopts = LOG_PID) 

Parameters

string $ident
string|integer $facility

Either one of the names of the keys in $this->facilities, or a LOG_* facility constant

string|integer $level

The minimum logging level at which this handler will be triggered

boolean $bubble

Whether the messages that are handled can bubble up the stack or not

integer $logopts

Option flags for the openlog() call, defaults to LOG_PID

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

reset()

reset() : void

pushProcessor()

pushProcessor(callable  $callback) 

{@inheritdoc}

Parameters

callable $callback

popProcessor()

popProcessor() 

{@inheritdoc}

getFormatter()

getFormatter() 

{@inheritdoc}

isHandling()

isHandling(array  $record) 

{@inheritdoc}

Parameters

array $record

setLevel()

setLevel(integer|string  $level) : self

Sets minimum logging level at which this handler will be triggered.

Parameters

integer|string $level

Level or level name

Returns

self

getLevel()

getLevel() : integer

Gets minimum logging level at which this handler will be triggered.

Returns

integer

setBubble()

setBubble(boolean  $bubble) : self

Sets the bubbling behavior.

Parameters

boolean $bubble

true means that this handler allows bubbling. false means that bubbling is not permitted.

Returns

self

getBubble()

getBubble() : boolean

Gets the bubbling behavior.

Returns

boolean —

true means that this handler allows bubbling. false means that bubbling is not permitted.

handleBatch()

handleBatch(array  $records) 

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

close()

close() 

{@inheritdoc}

__destruct()

__destruct() 

__sleep()

__sleep() 

getDefaultFormatter()

getDefaultFormatter() 

Gets the default formatter.

Overwrite this if the LineFormatter is not a good default for your handler.

write()

write(array  $record) 

{@inheritdoc}

Parameters

array $record

processRecord()

processRecord(array  $record) 

Processes a record.

Parameters

array $record

resetProcessors()

resetProcessors()