このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
最近の更新
use Monolog\Logger; use Monolog\Handler\StreamHandler; $monolog = new Logger('MONOLOG_TEST'); $handler = new StreamHandler('./app.log',Logger::DEBUG); $monolog->pushHandler($handler); $monolog->addDebug('debug log'); $monolog->addInfo('info log'); $monolog->addWarning('warning log'); $monolog->addError('error log');
[2019-02-07 16:41:41] MONOLOG_TEST.DEBUG: debug log [] [] [2019-02-07 16:41:41] MONOLOG_TEST.INFO: info log [] [] [2019-02-07 16:41:41] MONOLOG_TEST.WARNING: warning log [] [] [2019-02-07 16:41:41] MONOLOG_TEST.ERROR: error log [] []
use Monolog\Logger; use Monolog\Handler\RotatingFileHandler; $monolog = new Logger('MONOLOG_TEST'); $handler = new RotatingFileHandler('./app.log', 10, Logger::DEBUG); $monolog->pushHandler($handler); $monolog->addDebug('debug log'); $monolog->addInfo('info log'); $monolog->addWarning('warning log'); $monolog->addError('error log');
$ ls -la -rw-r--r-- 1 apache apache 476 Feb 7 16:38 app-2019-02-07.log