Description
Description
Let's assume this setup
monolog:
handlers:
console:
type: console
interactive_only: true # this is new
logstash:
type: stream
path: "php://stderr"
formatter: 'monolog.formatter.logstash'
Now let's assume we're running some command meant for non-interactive use, like messenger:consume
, see #57776.
When running the command using logging interactively (user running the command and watching the output) currently, you'll get both the command output, console output and the logstash JSON, which is creating a giant mess of output.
What would be better is to allow the logger to know if there's a user watching the output (command is in an interactive shell or not) and then:
- output
console
and skiplogstash
(prevent bubble) when interactive - skip
console
and only outputlogstash
when not interactive
This would mean the logging is adjusted to the current runtime better automatically.
Example
No response