'Logging/SLF4J'에 해당되는 글 1건

[SLF4J] SLF4J

Logging/SLF4J 2016. 5. 24. 15:58
donaricano-btn

What is the slf4j


1. Define

- The Simple Logging Facade for Java (SLF4J) serves as a simple facade or abstraction for various logging framework(java.util.logging, logback, log4j..) allowing the end user to plug in the desired logging framework at deployment time



2. Install

- http://www.slf4j.org/download.html

- slf4j-api-1.7.21


3. Hello world


3_1. Warning

- The warning is printed because no slf4j binding could be found on your class path

- The warning will disappear as soon as you add a binding to your class path. Assuming you add slf4j-simple-1.7.21.jar so that your class path contains


4. Typical usage pattern


5. Binding with a logging framework at deployment time

- SLF4J supports various logging frameworks. The SLF4J distribution ships with several jar files referred to as 'SLF4J binding', with each binding corresponding to a supported framework


5_1. To switch logging frameworks

Just replace slf4j bindings on your class path.

* For example

To switch from java.util.logging to log4j, just replace slfj-jdk14-1.7.21 jar with slf-j4-log4j12-1.7.21.jar




블로그 이미지

리딩리드

,