Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4
Non-blocking logging for PHP based on Amp and Monolog.
License
NotificationsYou must be signed in to change notification settings
amphp/log
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind.amphp/log
provides a non-blocking stream handler formonolog/monolog
.
This package can be installed as aComposer dependency.
composer require amphp/log
<?phpuseAmp\ByteStream;useAmp\Log\ConsoleFormatter;useAmp\Log\StreamHandler;useMonolog\Logger;requiredirname(__DIR__) .'/vendor/autoload.php';// You can also log to a file using amphp/file:// $handler = new StreamHandler(File\openFile(__DIR__ . '/example.log', 'w'));// Here we'll log to the standard output stream of the current process:$handler =newStreamHandler(ByteStream\getStdout());$handler->setFormatter(newConsoleFormatter);$logger =newLogger('main');$logger->pushHandler($handler);$logger->debug("Hello, world!");$logger->info("Hello, world!");$logger->notice("Hello, world!");$logger->error("Hello, world!");$logger->alert("Hello, world!");
About
Non-blocking logging for PHP based on Amp and Monolog.
Topics
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.