Skip to content

Commit

Permalink
Update logging.rst to update the Monolog section (tl lang)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arhell committed May 26, 2024
1 parent ff6908e commit 057415a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tl/core-libraries/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,14 @@ the CakePHP loggers, it is easy to use in your application as the default
logger.

After installing Monolog using composer, configure the logger using the
``Log::config()`` method::
``Log::setConfig()`` method::

// config/bootstrap.php

use Monolog\Logger;
use Monolog\Handler\StreamHandler;

Log::config('default', function () {
Log::setConfig('default', function () {
$log = new Logger('app');
$log->pushHandler(new StreamHandler('path/to/your/combined.log'));
return $log;
Expand All @@ -432,7 +432,7 @@ Use similar methods if you want to configure a different logger for your console
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

Log::config('default', function () {
Log::setConfig('default', function () {
$log = new Logger('cli');
$log->pushHandler(new StreamHandler('path/to/your/combined-cli.log'));
return $log;
Expand Down

0 comments on commit 057415a

Please sign in to comment.