Download the PHP package themehybrid/hybrid-log without Composer
On this page you can find all versions of the php package themehybrid/hybrid-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download themehybrid/hybrid-log
More information about themehybrid/hybrid-log
Files in themehybrid/hybrid-log
Package hybrid-log
Short Description Log package for the Hybrid Core framework.
License GPL-2.0-or-later
Homepage https://github.com/themehybrid/hybrid-log
Informations about the package hybrid-log
Hybrid Log
PSR-3 logging for Hybrid Core, built on Monolog. Configure named channels, write to one or several at once, and attach contextual data that follows every log entry.
Requirements
- PHP 8.2+
- Composer
Installation
Register both service providers during bootstrap. LogServiceProvider is required; ContextServiceProvider backs the Context facade and is expected by the log manager.
Configuration
Channels are defined in /config/logging.php. default names the channel used when you don't pick one.
Drivers
| Driver | Writes to |
|---|---|
single |
One file |
daily |
One file per day, rotated after days |
stack |
Several channels at once, listed in channels |
syslog |
System log |
errorlog |
PHP's error log |
slack |
A Slack incoming webhook (url, username, emoji) |
monolog |
Any Monolog handler, named in handler with with for constructor args |
custom |
A factory class named in via, returning a Monolog instance |
level accepts any PSR-3 level name and defaults to debug.
Writing logs
Pass contextual data as a second argument:
Choosing a channel
Sharing context
withContext() adds data to every subsequent entry on that channel. shareContext() does the same across all channels, including ones resolved later.
Context
The Context facade holds data that is attached to every log entry automatically, so you don't have to thread it through your call stack.
Hidden context is kept out of log entries. Use it for values you want available to your own code but not written to disk.
Other useful methods:
scope() runs a callback with extra context, then restores the previous state — even if the callback throws.
Each add, push and increment variant has a Hidden counterpart: addHiddenIf(), pushHidden(), popHidden(), onlyHidden(), and so on.
Helper functions
Listening for log entries
Testing
Copyright and License
This project is licensed under the GNU GPL, version 2 or later.
2008 – 2026 © Theme Hybrid.
Third-Party Licenses
Hybrid Log utilizes code from the illuminate/log package.
Repository: https://github.com/illuminate/log
License: MIT License - https://opensource.org/licenses/MIT
Copyright (c) Taylor Otwell