Search code examples
loggingserver

What log level are request logs?


There are 7 log levels: off, fatal, error, warn, info, debug, trace.

I'd like to log user requests to a server, what log level should request logs be?

What's a common practice here?

Info or debug?


Solution

  • I'd like to log user requests to a server

    Then presumably, you want to know this information. You don't generally run systems in debug mode in the normal course of business, rather you do so for a short time to gather information needed for a specific, limited, purpose.

    So I would say, you want info level rather than debug. I wouldn't go any further than that since a user logging in is not really something you need to be warned about, nor should it be considered an error (fatal or otherwise).