Download the PHP package stefna/log without Composer
On this page you can find all versions of the php package stefna/log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package log
Stefna Logger
Stefna\Logger\ManagerInterface
Class that handles creation of logger classes.
This is where you configure your main logger.
Methods
pushProcessor(callable $callback, string $channel = null): ManagerIf channel is set the process will only be applied to that channel. If no instance of channel exists the process will be silently ignored
Stefna\Logger\MonologManager
Manager that uses Monolog as the main logger.
It has one extra method on the manager and that's pushHandler that is so that you can configure custom handlers
for select channels
pushHandler(HandlerInterface $handler, $channel = null): ManagerIf channel is set the handler will only be applied to that channel. If no instance of channel exists the process will be silently ignored
Stefna\Logger\Logger Methods
setManager
Set log manager if this is not done all calls to getLogger will return a NullLogger
getManager
Get manager to add process or handler to main logger
setChannelConfig
Add a channel specific config
setGlobalConfig
Add multiple config options with one call
getLogger
Retrives a logging instance for channel
This method will create the logger if it don't exists and it check for configs for the specified channel
Example
Setup of a crash logger
Setup debouncer filter
This filter is meant to be used to prevent logs from being filed with the same errors
Setup
Using LogChannel with stefna/di
This will add the channel to the logger context.
This is useful to filter logs
Using DataDog processor
This processor is meant to be used with the DataDog agent to send the stack trace to DataDog.
And it also supports excluding frames from the stack trace. This is useful if you have a lot of duplicate frames in the stack trace, and you don't want to send them to DataDog. It's also nice to remove framework code from the stack traces since in most cases it's not relevant.