-
Notifications
You must be signed in to change notification settings - Fork 638
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
Logging tweaks #10916
Logging tweaks #10916
Conversation
Man. I just added these... 😄 |
@khalwat You can still configure them. I'll include examples. You also wont really need to, because they'll only take effect if you manually override the default level to be more verbose. |
Are you planning to add back in the rather useful method context that was in Craft 3 logs? Craft 3:
Craft 4:
That lack of method context ( Not sure why listing the log file in the log file is useful, except maybe for streamed logs where everything is combined? If that's the reasoning, could I suggest instead: I also find the new date/time format to be less readable too (yes, I know, ISO, etc.) |
What you're referring to is the
You were likely missing it before because I was erroneously adding all the global vars there too.
Not arbitrary. What you're seeing is Monolog's default formatter: While you can easily change this by setting
Again, we're using stock Monolog settings here: We will be working on docs with examples of how to customize all of this. |
@brandonkelly when you review, can you look at the Lines 83 to 85 in fdb540b
It was taken verbatim from https://github.com/craftcms/cms/blob/develop/src/queue/QueueLogBehavior.php#L99-L102, but wasn't 💯 sure what the purpose was. |
@timkelty The Craft 3 comment says |
# Conflicts: # src/log/MonologTarget.php
Description
devMode
to be set viaCRAFT_DEV_MODE
in bootstrapDbConfig::enableProfiling
,DbConfig::enableLogging
Connection
props usingdevMode
devMode
is nowLogLevel::INFO
Craft::debug
, meaning they won't be logged by default in devMode.components.log.monologTargetConfig.useMicrosecondTimestamps
)Request context
, followed by the multiline var output (ifallowLineBreaks
), otherwise as single-line json.When hitting
actions/app/health-check
indevMode
, this reduces the logs from52k
to3k
(2 lines).Related issues
Examples:
Request with
devMode
:With
components.log.monologTargetConfig.allowLineBreaks
set totrue
(the default, when indevMode
)With
components.log.monologTargetConfig.allowLineBreaks
set tofalse