AdobeDocs / experience-manager-learn.en

Apache License 2.0
12 stars 43 forks source link

Setting the log level for Stage/Production to INFO would be more practical #176

Closed nobhashim closed 8 months ago

nobhashim commented 8 months ago

Issue in ./help/cloud-service/debugging/cloud-service/logs.md

I have a different idea of the recommended log levels below.

Local Development (AEM SDK): DEBUG Development: DEBUG Stage: WARN Production: ERROR

Setting the log level to INFO for Stage and Production is more preferable. It is too hard to identify the cause of an incident with ERROR/WARN messages. Especially when the issue occurred once only on Production. I would appreciate if you reconsider the recommendation.

nobhashim commented 8 months ago

Another document that recommends ERROR for Production. https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/developing/development-guidelines.html?lang=en

davidjgonzalez commented 8 months ago

@nobhashim you can of course set the log levels as you require - these are simply base recommendations for how log levels are intended to be used. If you have a valid business need to need to log all normal operations in a production, you can do this!

The rationale behind this is:

  1. In production you should have all your WARNs conditions resolved (as you fixed them in Stage when you performed your various testing).
  2. Production should also be performing normal operations "all the time" so logging them isn't particularly interesting unless you run into an erroring conditions.
  3. Erroring conditions should log an error message with complete details of the error (so an aggregate of state, conditions, etc. that might be logged at INFO for non-erroring items). This makes is very easy to identify, troubleshoot, and resolve issues.

But again, please feel free to adjust logging as you need -- and remember you can also adjust log levels by Java package incase you need some set of functionality to be logged at a higher/lower level.