From a8d51fbb1082a1b8920a37ac61d511f51d4e3113 Mon Sep 17 00:00:00 2001 From: butschster Date: Mon, 6 Nov 2023 23:39:58 +0400 Subject: [PATCH] Fixes information about monolog log format fixes #639 --- docs/en/basics/logging.md | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/docs/en/basics/logging.md b/docs/en/basics/logging.md index 943dd6ec..88b7cf73 100644 --- a/docs/en/basics/logging.md +++ b/docs/en/basics/logging.md @@ -102,6 +102,23 @@ return [ > **Note** > Use `MONOLOG_DEFAULT_CHANNEL` env variable to specify the default handler that should be used in your application. +### Log format + +By default, the handler will format the log message using the following +structure `[%datetime%] %level_name%: %message% %context%\n`. + +If you want to change the log message structure, you can set up the `MONOLOG_FORMAT` evn variable like in the example +below: + +```dotenv .env +MONOLOG_FORMAT=[%datetime%] %level_name%: %message% %context%\n +``` + +> **See more** +> Read more about the available placeholders in +> the [Monolog documentation](https://seldaek.github.io/monolog/doc/message-structure.html). + + ## Register handler In addition to configuring the logging component through a config file or bootloader, you can also register handlers via @@ -180,18 +197,6 @@ return [ :::: -By default, the handler will format the log message using the following structure `%message% %context% %extra%\n` - -If you want to change the log message structure, you can use the `LOGGER_FORMAT` evn variable: - -```dotenv .env -LOGGER_FORMAT=[%datetime%] %channel%.%level%: %message% %context% %extra%\n -``` - -> **See more** -> Read more about the available placeholders in -> the [Monolog documentation](https://seldaek.github.io/monolog/doc/message-structure.html). - ## Usage ### Send logs to the default channel