openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
165 stars 135 forks source link

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

Closed marthauk closed 1 year ago

marthauk commented 5 years ago

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.

edtanous commented 5 years ago

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.

marthauk commented 5 years ago

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.

edtanous commented 3 years ago

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 commented 1 year ago

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