bmcweb icon indicating copy to clipboard operation
bmcweb copied to clipboard

BMCWEB; logging-level set to DEBUG in bmcweb/src/webserver_main.cpp

Open marthauk opened this issue 5 years ago • 3 comments

In bmcweb/src/webserver_main.cpp log-level is set explicitly to DEBUG: crow::logger::setLogLevel(crow::LogLevel::DEBUG). The log-level should, in my opinion be set by BMCWEB_LOG_LEVEL defined in bmcweb/crow/include/crow/settings.h. As a consequence of this, setLogLevel( LogLevel level) may need to be changed.

marthauk avatar Oct 10 '19 14:10 marthauk

I see some thoughts here, but I don't really see a "why" stated. settings.h is a file that's slated for deletion as it's old, and isn't actually used anymore at this point. The intent for the logging system at the moment is logs are either enabled, or disabled through the BMCWEB_ENABLE_LOGGING macro.

edtanous avatar Oct 15 '19 16:10 edtanous

I didn't know that the settings.h file was slated for deletion. But I think its weird that there isn't a way of configuring logging for bmcweb (other than enabling or disabling it). Using BMCWEB_LOG_LEVEL makes sense in my opinion.

The why; Configuring logging-level by using BMCWEB_LOG_LEVEL would allow for user configuration of logging through CMake file rather than having to patch the code to set the log-level. This could be useful in some debugging purposes, especially since having the default DEBUG log level enabled as is per now, fills the logs with a lot of information. In some cases, it might be more meaningful to set a higher log-level. For production-code, it might also make sense to set log-level WARNING or ERROR.

marthauk avatar Oct 17 '19 06:10 marthauk

especially since having the default DEBUG log level enabled as is per now, fills the logs with a lot of information.

To some extent, this is the point. When we ask for logs from people, it's quite unhelpful if they' don't include all the information we need to help triage. I'm aware that there are some views that we should be more consistent in how we assign log levels in debug statement, and that we should make them more fine grained. If you have some ideas in that area, I'd be interested to see either your ideas, or preferably patches to do this.

edtanous avatar Apr 23 '21 00:04 edtanous

No progress here in a long time, and logging has been changed in ways that make this obsolete. Closing.

edtanous avatar Feb 22 '23 18:02 edtanous