Fork me on GitHub
#java
<
2019-01-30
>
mathpunk17:01:35

Most of my job is black box testing our Java/Spring/Angular application. My nightly tests are not working so well, so I'm looking at log output. I could parse these strings into data structures, but it just occurred to me: since logging in Java seems to require handing the logger some implementation, is there an implementation that will produce structured data instead of strings?

donaldball18:01:40

Logback is pretty happy emitting json, though I don’t know how hard or possible it would be for it to emit message with attributes beyond the ones it records intrinsically

hiredman23:01:40

there is a thing, "Mapped Diagnostic Context" that you can put key/value information in, and it will be logged as a json object with the json log output