FirstStep
1. Requirements
- Logback-classic module requires the presence of slf4j-api.jar and logbacl-core.jar in addition to logback-classic.jar on the classpath
- Launching the HelloWorld application will output a single line on the console. By virtue of logback's default configuration policy, when no default configuration file is found, logback will add a ConsoleAppender to the root logger
- logback can report information about its internal state using a built-in status system
2. Internal state
- logback will automatically print its internal state on the console
2_1. enable logging requirement
1) Configure the logback environment. You can do so in several more or less sophisticated ways. More on the later
2) In every class where you with to perform logging, retrieve a Logger instance by invoking the org.slf4j.LoggerFactory class' getLogger() method, passing the current class name or the class itself as a parameter
3) Use the logger instance by invoking its printing methods, namely the debug(), info(), warn()and error() methods, This will produce logging output on the configured appenders
'Logging > LogBack' 카테고리의 다른 글
[LogBack] 3_3. Configuration-Syntax (0) | 2016.06.03 |
---|---|
[LogBack] 3_2. Configuration-with logback-test.xml or logback.xml (0) | 2016.06.02 |
[LogBack] 3_1. Configuration-Automatically (0) | 2016.05.31 |
[LogBack] 2. Architecture (0) | 2016.05.26 |
[LogBack] 0. Define (0) | 2016.05.25 |