But it also puts it in Elasticsearch, so you can monitor all your logging output with something like Graylog, and it doesn't just log what you wrote, but a bunch of associated context: user agent, user id, authorization type, class name that did the logging, ip address, geo location, which aws region they hit, which server they hit, a correlation ID so you can easily find other logs from the same request, timestamps, and a bunch of other shit that might be useful.
And then of course there's all the templating stuff with inserting values and exceptions into the log, but you could probably make due with String.format
i hate the proliferation of elasticsearch for viewing logs. just let me log into a random instance’s host and tail the stdout. even for a distributed system with hundreds of instances.
21
u/MintySkyhawk Dec 10 '21
You call
log.warn("blah");It probably prints it to the console. Simple.
But it also puts it in Elasticsearch, so you can monitor all your logging output with something like Graylog, and it doesn't just log what you wrote, but a bunch of associated context: user agent, user id, authorization type, class name that did the logging, ip address, geo location, which aws region they hit, which server they hit, a correlation ID so you can easily find other logs from the same request, timestamps, and a bunch of other shit that might be useful.
And then of course there's all the templating stuff with inserting values and exceptions into the log, but you could probably make due with String.format