Created
August 9, 2018 09:57
-
-
Save jiahut/654ecc75a13b0a1d8f3b4d5d2d69dc6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.slf4j.LoggerFactory | |
import org.slf4j.bridge.SLF4JBridgeHandler | |
import java.util.logging.Logger | |
class MyLog { | |
private Logger logger = Logger.getLogger("jul") | |
private org.slf4j.Logger log = LoggerFactory.getLogger(MyLog.class); | |
void log() { | |
SLF4JBridgeHandler.removeHandlersForRootLogger() | |
SLF4JBridgeHandler.install() | |
logger.info("jul log") | |
log.info("slf4j log ") | |
log.debug("slf4j log ") | |
} | |
} | |
MyLog.newInstance().log() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment