-
-
Save kaihendry/6ad32ed135e3d679e6dd896365b252cb to your computer and use it in GitHub Desktop.
{"level":"info","ts":1726946030.4808884,"msg":"capture me monolog","syslog_level":"notice"}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use Monolog\Logger; | |
use Monolog\Handler\StreamHandler; | |
use Monolog\Formatter\JsonFormatter; | |
use Monolog\ErrorHandler; | |
$log = new Logger('name'); | |
$stderrHandler = new StreamHandler('php://stderr', Logger::DEBUG); | |
$stderrHandler->setFormatter(new JsonFormatter()); | |
$log->pushHandler($stderrHandler); | |
ErrorHandler::register($log); | |
$log->info('monolog test!'); | |
error_log("capture me monolog"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment