Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logging.rst to update the Monolog section (tl lang) #7858

Merged
merged 1 commit into from
May 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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