java

mathpunk 2019-01-30T17:37:35.006900Z

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?

donaldball 2019-01-30T18:22:40.008Z

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

2019-01-30T23:41:40.008800Z

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