The logging statements should use more appropriate logging levels, and they should be consistent throughout the code. For examaple, similar statements like this and this are using different logging levels. In addition, they are probably more appropriate as DEBUG rather than INFO or WARN.
Here is a quick rundown of when to use which levels:
TRACE
This is the the lowest level. As the name implies, this is useful for logging in great detail exactly what the program is doing; maybe things like "before calling method X", "after calling method X", etc. We don't really use this much at HiDA.
DEBUG
Next highest level. Things logged at this level are probably helpful for debugging the application. Things like method entry, exit, and results of computations.
INFO
The next highest level. These are statements that we want to log during production in order to help monitor the application. Things like each time a REST endpoint is hit, or a user logs in or out would make sense here.
WARN
Next highest. Pretty self-explanatory here; for errors or unxpected conditions but not too bad. For example, if a request took longer than expected, we might log it as a warning.
ERROR
Highest level, and again pretty self-explanatory. Things that are more serious than WARN go here; for example inability to connect to the database.
The logging statements should use more appropriate logging levels, and they should be consistent throughout the code. For examaple, similar statements like this and this are using different logging levels. In addition, they are probably more appropriate as
DEBUG
rather thanINFO
orWARN
.Here is a quick rundown of when to use which levels:
TRACE
This is the the lowest level. As the name implies, this is useful for logging in great detail exactly what the program is doing; maybe things like "before calling method X", "after calling method X", etc. We don't really use this much at HiDA.DEBUG
Next highest level. Things logged at this level are probably helpful for debugging the application. Things like method entry, exit, and results of computations.INFO
The next highest level. These are statements that we want to log during production in order to help monitor the application. Things like each time a REST endpoint is hit, or a user logs in or out would make sense here.WARN
Next highest. Pretty self-explanatory here; for errors or unxpected conditions but not too bad. For example, if a request took longer than expected, we might log it as a warning.ERROR
Highest level, and again pretty self-explanatory. Things that are more serious thanWARN
go here; for example inability to connect to the database.