Best Practices
The following are considered as best practices
1. Get Loggers by Class
2. Declare Loggers as Static Constants
3. Format Log Statements Consistently
4. Parameterize Log Statements with Tokens
5. Use Log Levels to Indicate Severity
6. Use Log Filters for Focus
7. Include Categories to Show Class Names
8. Use Guard Conditions Appropriately
9. Configure Logging at Runtime.
First, create an Utility class
Then configure the logging parameters
Finally, use the logging as required
- 27 reads