Text based logging has the disadvantage that they are hard to read and understand. Is there a library that would allow me to generate structured and visually aesthetic log file?
For example, on issue following log statement:
logger.log('Request received from gateway', request)
The output could be something like this:
<p>Request received from gateway. <a href='detail.html#163'>Details</a></p>
So that the log file log.html
shows:
Thursday 14th March 04:8:13 - Request received from gateway.
Details
Here details could be an anchored hyperlink into another html file with the String dump of the request object.
The advantage of this approach would be that the verbosity would be reduced. Instead of all the details being dumped onto the screen at once, we'd only see the overview. Details would appear in a popup window if and when we need to see it.
How could I create more readable, structured logs in Java?