envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.72k stars 4.76k forks source link

Fine-grain-logging and component-log-level are incompatible #35073

Open ravenblackx opened 2 months ago

ravenblackx commented 2 months ago

Command line flag --enable-fine-grain-logging lets us use per-file loglevel configuration, but makes per-component loglevel configuration not work any more. One result of this is that users are surprised when adding

--log-level info --component-log-level http:debug

does not provoke the logging of headers that one might expect.

Further, there is no command line mechanism for starting up with specific loglevels enable for the fine-grain logger.

I'm proposing two things:

  1. if the command line includes both --enable-fine-grain-logging and --component-log-level, this should be an error rather than a surprise later that you didn't get the behavior you asked for.
  2. A new command line option --fine-grain-log-level-paths that accepts the paths= format as specified in the fine grain logs docs, e.g. --fine-grain-log-level-paths=source/common/http/conn_manager_impl.cc:debug.
htuch commented 2 months ago

@yanavlasov @jmarantz @alyssawilk @mattklein123

botengyao commented 1 month ago

Thanks @ravenblackx!

Making two mutually exclusive is reasonable to me, since fine grain logger is using its own management system and they are also mutually exclusive in the marcos.

yeah, we should add this command line option, we added the support to the admin /logging and we can do the similar thing for the command line options.

I will update the doc a little bit to reflect the most recent status for fine-grain logger. Thanks!