SLF4J - How to use it properly | Java Logging Hell & How to stay out of it

preview_player
Показать описание
► Java/Spring courses & guides

► Newsletter

► YouTube sub

Whenever you are working with SLF4J, there's a couple of basic things to keep in your head. In this episode you'll learn three of these basic tricks ( no tricks, really ;) )
Рекомендации по теме
Комментарии
Автор

The reason for not using string concatenation in finer log levels is to avoid the cost of message construction as well as conversions to string when you don't need it. (With enough logging method overloads for each level, even the object array creation can be avoided.) So the primary purpose here is not a readability concern. Of course it all depends, it will be the loops and/or thread pools where logging will take its toll the most, and it's all situational (could be premature optimization). It will matter most on production systems that have to perform fast, serve many users, and e.g. disabling debug logging is the norm.

SirWolf
Автор

@1:27 it is still recommended to use "if isDebugEnabled", because it dose not create array of arguments which are normally logged

farooqmss
Автор

where can i find the first video the configuration part?

naweedsafi
Автор

INFO in - Could NOT find resource [logback-test.xml] <--- Throwing this error

samchak
Автор

could you please let us see your import statements my ide doen't automically add imports thanks

danteyeong
Автор

Very nice tutorial! One question - how can I add loggin message of sub-class in superclass that handles all the logging. So basically i am using a method from superclass in subclass and want the subclass name to be logged instead of superclass.

katdareshruti