Logback is promising log library I think, So in this time, I am going to set up logback in Java and Scala project using maven.
Setting up logback is quite straitforward and simple.
At first, you have to download maven dependencies.
Things to remember you have to, org.slf4j library and ch.qos.logback libraries version should match each other. Otherwise, you have error message during executing program.
In my case, org.sl4j 1.7.5 and logback 1.0.13 are perfectly matched.
And then put configuration file to the classpath. (i.e. src/main/resources/logback.xml)
Configuration file is something like below.Finally, create logger instance by LoggerFactory.
You don't have to learn how to use this library. It's same as log4j. You can use logger like below.
In Java,
'Programming > Java' 카테고리의 다른 글
unit test 가 아닌 것들 (0) | 2015.11.25 |
---|---|
Linux cron vs Spring cron (0) | 2014.03.06 |
spring restful service - JSON response (0) | 2013.09.13 |
IntelliJ GenerateSerialVersionUID (0) | 2013.09.13 |
maven - set properties file content from command line (0) | 2013.08.30 |