How To Log Records In JSON With Spring Boot And Logback

preview_player
Показать описание
Hey, fam! In this tutorial, I'll demo how to give your log records a bit more structure by logging directly in JSON format using Spring Boot and Jackson.

🍃 Grab the code

🙌 Get in Touch

🍿 Subscribe if you want to see more Spring Boot + Kotlin tutorials!
Рекомендации по теме
Комментарии
Автор

Very cool. json looks way better than normal text format.

anoozg
Автор

Hi Alex,
Can you make tutorial on structured logs, where we can provide custom <key, value>
for logging

dipakprajapati
Автор

My biggest headache as a beginner into microservices is logging. How and what to log, how the controller advice's come into play for exceptions and logging those, how structured logging will come into play and configuring logback for container logs and all.

It would be helpful if you can cover more in depth of logging as a whole when writing microservices, especially in a containerized environment.

Cheers :)

vishnugovindan
Автор

Great tutorial, Thank you very much, Alex! I am new to Kolin. A small question about the logger in Kotlin. In Java we often use static LoggerFactory.getLogger(...) to get a reference to the logger. What is the best approach do you suggest in Kotlin class?

zhuxiaoyueric
Автор

This is great to learn but is that good to use these old dependencies for the latest projects like logback-Jackson the last update is 2016. After that no any update, So my question is like - Is that okay to use these old dependecies in new project or not?

swapnilk
Автор

Nice! Thanks for making content on Spring + Kotlin.
Do you have any example on setting up logback programmatically instead of through XML?

Thanks

Alberto_Cavalcante
Автор

Nice and simple. Thanks for the video. My only concern with this is the lack of straightforward integration between this approach and tracing. The logger and appender provided in this video will overwrite the default one from spring, removing the tracing itself, so you will have to add the pattern again to include it for tracing. A simple suggestion would be to overwrite the logging.pattern.console configuration on spring application.yml/properties with a json format and that won't require any dependency at all

paulushcgcj