Writes log messages to syslog

package Default
inherited_from \Zend\Log\Writer\AbstractWriter

 Methods

Constructor

__construct(array $params = null) : \Zend\Log\Writer\Syslog

Set options for a writer. Accepted options are:

  • filters: array of filters to add to this filter
  • formatter: formatter for this writer
inherited_from \Zend\Log\Writer\AbstractWriter::__construct()

Parameters

$params

array

Array of options; may include "application" and "facility" keys

Returns

\Zend\Log\Writer\Syslog

Constructor

__construct(array|\Traversable $options = null
Inherited

Set options for a writer. Accepted options are:

  • filters: array of filters to add to this filter
  • formatter: formatter for this writer

Parameters

$options

array\Traversable

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Add a filter specific to this writer.

addFilter(integer|string|\Zend\Log\Filter\FilterInterface $filter, array|null $options = null) : \Zend\Log\Writer\AbstractWriter
Inherited
inherited_from \Zend\Log\Writer\WriterInterface::addFilter()

Parameters

$filter

integerstring\Zend\Log\Filter\FilterInterface

$options

arraynull

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Returns

\Zend\Log\Writer\AbstractWriter

Get filter instance

filterPlugin(string $name, array|null $options = null) : \Zend\Log\Filter\FilterInterface
Inherited

Parameters

$name

string

$options

arraynull

Returns

\Zend\Log\Filter\FilterInterface

Get formatter instance

formatterPlugin(string $name, array|null $options = null) : \Zend\Log\Formatter\FormatterInterface
Inherited

Parameters

$name

string

$options

arraynull

Returns

\Zend\Log\Formatter\FormatterInterface

Get filter plugin manager

getFilterPluginManager() : \Zend\Log\Writer\FilterPluginManager
Inherited

Returns

\Zend\Log\Writer\FilterPluginManager

Get formatter plugin manager

getFormatterPluginManager() : \Zend\Log\Writer\FormatterPluginManager
Inherited

Returns

\Zend\Log\Writer\FormatterPluginManager

Set application name

setApplicationName(string $appName) : \Zend\Log\Writer\Syslog

Parameters

$appName

string

Application name

Returns

\Zend\Log\Writer\Syslog

Set convert write errors to exception flag

setConvertWriteErrorsToExceptions(boolean $convertErrors) 
Inherited

Parameters

$convertErrors

boolean

Set syslog facility

setFacility(integer $facility) : \Zend\Log\Writer\Syslog

Parameters

$facility

integer

Syslog facility

Exceptions

\Zend\Log\Exception\InvalidArgumentException for invalid log facility

Returns

\Zend\Log\Writer\Syslog

Set filter plugin manager

setFilterPluginManager(string|\Zend\Log\Writer\FilterPluginManager $plugins) : \Zend\Log\Writer\Syslog
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$plugins

string\Zend\Log\Writer\FilterPluginManager

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Returns

\Zend\Log\Writer\Syslog

Set a new formatter for this writer

setFormatter(string|\Zend\Log\Formatter\FormatterInterface $formatter, array|null $options = null) : \Zend\Log\Writer\Syslog
Inherited
inherited_from \Zend\Log\Writer\WriterInterface::setFormatter()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$formatter

string\Zend\Log\Formatter\FormatterInterface

$options

arraynull

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Returns

\Zend\Log\Writer\Syslog

Set formatter plugin manager

setFormatterPluginManager(string|\Zend\Log\Writer\FormatterPluginManager $plugins) : \Zend\Log\Writer\Syslog
Inherited
fluent This method is part of a fluent interface and will return the same instance

Parameters

$plugins

string\Zend\Log\Writer\FormatterPluginManager

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Returns

\Zend\Log\Writer\Syslog

Close syslog.

shutdown() : void
inherited_from \Zend\Log\Writer\AbstractWriter::shutdown()

Perform shutdown activities such as closing open resources

shutdown() : void
Inherited
inherited_from \Zend\Log\Writer\WriterInterface::shutdown()

Log a message to this writer.

write(array $event) : void
Inherited
inherited_from \Zend\Log\Writer\WriterInterface::write()

Parameters

$event

array

log data event

Write a message to syslog.

doWrite(array $event) : void
inherited_from \Zend\Log\Writer\AbstractWriter::doWrite()

Parameters

$event

array

event data

Write a message to the log

doWrite(array $event) : void
Inherited

Parameters

$event

array

log data event

Get formatter

getFormatter() : \Zend\Log\Formatter\FormatterInterface
Inherited

Returns

\Zend\Log\Formatter\FormatterInterface

Check if the writer has a formatter

hasFormatter() : boolean
Inherited

Returns

boolean

Initialize syslog / set application name and facility

initializeSyslog() : void

Initialize values facilities

initializeValidFacilities() : void

 Properties

 

Application name used by this syslog-writer instance

$appName : string

Default

'Zend\Log'
 

Use Zend\Stdlib\ErrorHandler to report errors during calls to write

$convertWriteErrorsToExceptions : boolean

Default

true
 

The default log priority - for unmapped custom priorities

$defaultPriority : string

Default

LOG_NOTICE
 

Error level passed to Zend\Stdlib\ErrorHandler::start for errors reported during calls to write

$errorsToExceptionsConversionLevel : boolean

Default

E_WARNING
 

Facility used by this syslog-writer instance

$facility : integer

Default

LOG_USER
 

Filter plugins

$filterPlugins : \Zend\Log\Writer\FilterPluginManager

Default

 

Filter chain

$filters : array<mixed,\Zend\Log\Filter\FilterInterface>

Default

array()
 

Formats the log message before writing

$formatter : \Zend\Log\Formatter\FormatterInterface

Default

 

Formatter plugins

$formatterPlugins : \Zend\Log\Writer\FormatterPluginManager

Default

 

Last application name set by a syslog-writer instance

$lastApplication : string

Default

Static
 

Last facility name set by a syslog-writer instance

$lastFacility : string

Default

Static
 

Maps Zend\Log priorities to PHP's syslog priorities

$priorities : array

Default

array(\Zend\Log\Logger::EMERG => LOG_EMERG, \Zend\Log\Logger::ALERT => LOG_ALERT, \Zend\Log\Logger::CRIT => LOG_CRIT, \Zend\Log\Logger::ERR => LOG_ERR, \Zend\Log\Logger::WARN => LOG_WARNING, \Zend\Log\Logger::NOTICE => LOG_NOTICE, \Zend\Log\Logger::INFO => LOG_INFO, \Zend\Log\Logger::DEBUG => LOG_DEBUG)
 

Types of program available to logging of message

$validFacilities : array

Default

array()