...
It isn't the aim of this document to reiterate Best Practices, so advice here is general:
- Use a logger logging facade such as SLF4J or EELF.
- Write log messages in English.
- Write meaningful messages. Consider what will be useful to consumers of logger output.
- Log at the appropriate level. Be aware of the volume of logs that will be produced.
- Safeguard the information in exceptions, and ensure it is never lost.
- Use errorcodes to characterise exceptions.
- Log in a machine-readable format. See Conventions.
- Log for analytics as well as troubleshooting.
...