StreamHandler
extends BaseHandler
in package
Uses
SetOptionsTrait
Tags
Table of Contents
- $filters : array<string|int, LogFilter>
- List of filters relevant only to this handler.
- $formatters : array<string|int, LogFormatter>
- Formatters for this handler
- $mode : string
- The open mode.
- $stream : null|resource
- Holds the PHP stream to log to.
- $streamOrUrl : string
- The stream uri to open.
- $options : Options
- __construct() : mixed
- Class Constructor
- __wakeup() : mixed
- Wakup function - reattaches stream.
- addFilter() : void
- Add a filter specific to this handler.
- log() : void
- Log a message to this handler.
- setOption() : bool
- Sets an option specific to the implementation of the log handler.
- write() : bool
- Write a message to the log.
Properties
$filters
List of filters relevant only to this handler.
protected
array<string|int, LogFilter>
$filters
= []
$formatters
Formatters for this handler
protected
array<string|int, LogFormatter>
$formatters
= []
$mode
The open mode.
protected
string
$mode
$stream
Holds the PHP stream to log to.
protected
null|resource
$stream
= null
$streamOrUrl
The stream uri to open.
protected
string
$streamOrUrl
$options
private
Options
$options
Methods
__construct()
Class Constructor
public
__construct(mixed $streamOrUrl[, string $mode = 'a+' ][, Options $options = null ][, array<string|int, LogFormatter>|null $formatters = null ]) : mixed
Parameters
- $streamOrUrl : mixed
-
Stream or URL to open as a stream.
- $mode : string = 'a+'
-
Mode, only applicable if a URL is given.
- $options : Options = null
- $formatters : array<string|int, LogFormatter>|null = null
-
Log formatter.
Tags
Return values
mixed —__wakeup()
Wakup function - reattaches stream.
public
__wakeup() : mixed
Tags
Return values
mixed —addFilter()
Add a filter specific to this handler.
public
addFilter(LogFilter $filter) : void
Handlers cannot undo the filtering at logger level
Parameters
- $filter : LogFilter
-
Filter to add.
Return values
void —log()
Log a message to this handler.
public
log(LogMessage $event) : void
Check all filters and expand it before delegating to the write method
Parameters
- $event : LogMessage
-
Log event.
Return values
void —setOption()
Sets an option specific to the implementation of the log handler.
public
setOption(string $optionKey, mixed $optionValue) : bool
Parameters
- $optionKey : string
-
Key name for the option to be changed. Keys are handler-specific.
- $optionValue : mixed
-
New value to assign to the option
Tags
Return values
bool —True.
write()
Write a message to the log.
public
write(LogMessage $event) : bool
Parameters
- $event : LogMessage
-
Log event.
Tags
Return values
bool —True.