Hi,
I have a question about the used logging conventions in Stanbol. I see
log message for method entries and exits with log level INFO.
Furthermore, there seems to be no common standard how to write log
messages to make them easily readable and to find the position in the
code where the message came from.
My proposal would be to use the following conventions that I
personally use for my applications and that I have adopted from other
industrial projects.
- The default log level for messages is DEBUG (especially for logging
method entries/exits)
- Only use INFO if the message is important to follow the main flow of
the application. So if something happens that would be useful to note
if not in debug mode to see what is basically going on in the
application.
- Start log messages with the name of the method where the message was
created, e.g. log.debug("getSiteX() called with parameter {}",
parameter); - This makes it easy to find the log message in the code
and gives developers an immediate hint where the action took place
(beside the class).
WDYT?
Best,
--
Fabian