Skip to content

Commit 5821959

Browse files
authored
Merge pull request #639 from craftcms/bugfix/log-levels
Clarify and correct logging levels
2 parents f3b5de5 + 5f820f5 commit 5821959

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

docs/4.x/logging.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,13 @@ You can log your own messages from a plugin or module.
295295

296296
Convenience methods are available for different severity levels:
297297

298-
- `Craft::trace()` – verbose, fine-grained annotations—sometimes temporary—used for support or debugging
299298
- `Craft::debug()` – non-essential information that can be used for debugging issues
300299
- `Craft::info()` – standard level for informative contextual details
301300
- `Craft::warning()` – messages that indicate something problematic or unexpected even though everything continues to work
302301
- `Craft::error()` – most urgent level before an exception, used to indicate that something didn’t function properly
303302

304303
::: tip
305-
By default, Craft logs all levels when <config4:devMode> is enabled. Otherwise, anything lower than `warning` will be ignored.
304+
By default, Craft logs levels `info` and up when <config4:devMode> is enabled. Otherwise, anything lower than `warning` will be ignored.
306305
:::
307306

308307
Logged messages should designate a message body, level, and optional category. Here, the we’re using the `custom-module` category, overriding the default of `application`:

docs/5.x/system/logging.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,13 @@ You can log your own messages from a plugin or module.
291291

292292
Convenience methods are available for different severity levels:
293293

294-
- `Craft::trace()` – verbose, fine-grained annotations—sometimes temporary—used for support or debugging
295294
- `Craft::debug()` – non-essential information that can be used for debugging issues
296295
- `Craft::info()` – standard level for informative contextual details
297296
- `Craft::warning()` – messages that indicate something problematic or unexpected even though everything continues to work
298297
- `Craft::error()` – most urgent level before an exception, used to indicate that something didn’t function properly
299298

300299
::: tip
301-
By default, Craft logs all levels when <config5:devMode> is enabled. Otherwise, anything lower than `warning` will be ignored.
300+
By default, Craft logs levels `info` and up when <config5:devMode> is enabled. Otherwise, anything lower than `warning` will be ignored. To override this behavior, set the `level` property in your [log configuration](#monolog).
302301
:::
303302

304303
Logged messages should designate a message body, level, and optional category. Here, the we’re using the `custom-module` category, overriding the default of `application`:

0 commit comments

Comments
 (0)