Buffers all events until the strategy determines to flush them.

see
package Default
inherited_from \Zend\Log\Writer\AbstractWriter

 Methods

Constructor

__construct(\Zend\Log\Writer\WriterInterface|string|array|\Traversable $writer, \Zend\Log\Filter\FilterInterface|integer $filterOrPriority = null, integer $bufferSize = 0

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

$writer

\Zend\Log\Writer\WriterInterfacestringarray\Traversable

Wrapped writer or array of configuration options

$filterOrPriority

\Zend\Log\Filter\FilterInterfaceinteger

Filter or log priority which determines buffering of events

$bufferSize

integer

Maximum buffer size

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

Get writer plugin manager

getWriterPluginManager() : \Zend\Log\WriterPluginManager

Returns

\Zend\Log\WriterPluginManager

Resets the state of the handler.

reset() 

Stops forwarding records to the wrapped writer

Set convert write errors to exception flag

setConvertWriteErrorsToExceptions(boolean $convertErrors) 
Inherited

Parameters

$convertErrors

boolean

Set filter plugin manager

setFilterPluginManager(string|\Zend\Log\Writer\FilterPluginManager $plugins) : \Zend\Log\Writer\FingersCrossed
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\FingersCrossed

Stub in accordance to parent method signature.

setFormatter(string|\Zend\Log\Formatter\FormatterInterface $formatter) : \Zend\Log\Writer\WriterInterface

Fomatters must be set on the wrapped writer.

inherited_from \Zend\Log\Writer\AbstractWriter::setFormatter()

Parameters

$formatter

string\Zend\Log\Formatter\FormatterInterface

Returns

\Zend\Log\Writer\WriterInterface

Set a new formatter for this writer

setFormatter(string|\Zend\Log\Formatter\FormatterInterface $formatter, array|null $options = null) : \Zend\Log\Writer\FingersCrossed
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\FingersCrossed

Set formatter plugin manager

setFormatterPluginManager(string|\Zend\Log\Writer\FormatterPluginManager $plugins) : \Zend\Log\Writer\FingersCrossed
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\FingersCrossed

Set a new writer

setWriter(string|\Zend\Log\Writer\WriterInterface $writer, array|null $options = null) : \Zend\Log\Writer\FingersCrossed
fluent This method is part of a fluent interface and will return the same instance

Parameters

$writer

string\Zend\Log\Writer\WriterInterface

$options

arraynull

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Returns

\Zend\Log\Writer\FingersCrossed

Set writer plugin manager

setWriterPluginManager(string|\Zend\Log\WriterPluginManager $plugins) : \Zend\Log\Writer\FingersCrossed

Parameters

$plugins

string\Zend\Log\WriterPluginManager

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Returns

\Zend\Log\Writer\FingersCrossed

Record shutdown

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_from \Zend\Log\Writer\AbstractWriter::write()

Parameters

$event

array

log data event

Log a message to this writer.

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

Parameters

$event

array

log data event

Get writer instance

writerPlugin(string $name, array|null $options = null) : \Zend\Log\Writer\WriterInterface

Parameters

$name

string

$options

arraynull

Returns

\Zend\Log\Writer\WriterInterface

Write message to buffer or delegate event data to the wrapped writer

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

Check if buffered data should be flushed

isActivated(array $event) : boolean

Parameters

$event

array

event data

Returns

booleantrue if buffered data should be flushed

 Properties

 

array of log events

$buffer : array

Default

array()
 

Oldest entries are removed from the buffer if bufferSize is reached.

$bufferSize : integer

Default

0 is infinte buffer size.

 

Flag if buffering is enabled

$buffering : boolean

Default

true
 

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

$convertWriteErrorsToExceptions : boolean

Default

true
 

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

$errorsToExceptionsConversionLevel : boolean

Default

E_WARNING
 

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

 

The wrapped writer

$writer : \Zend\Log\Writer\WriterInterface

Default

 

Writer plugins

$writerPlugins : \Zend\Log\WriterPluginManager

Default