What is logback?
Logback is intended as a successor to the popular log4j project. It was designed by Ceki Gülcü, log4j's founder.

package chapters.introduction;import org.slf4j.Logger;import org.slf4j.LoggerFactory;publicclassHelloWorld1{publicstaticvoid main(String[] args){Logger logger =LoggerFactory.getLogger("chapters.introduction.HelloWorld1");
logger.debug("Hello world.");}}
Logger, Appenders and Layouts
Logback is built upon three main classes: Logger, Appender and Layout. These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported.
The Logger class is part of the logback-classic module. On the other hand, the Appender and Layout interfaces are part of logback-core. As a general-purpose module, logback-core has no notion of loggers.

Logger context
The first and foremost advantage of any logging API over p…