Created
September 4, 2016 11:22
-
-
Save jcf/fc1fe9c10c6d41045e4dba2c29cb6499 to your computer and use it in GitHub Desktop.
Refresh logback.xml from a Clojure REPL
This file contains 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
(ns app.log | |
(:require [clojure.java.io :as io]) | |
(:import ch.qos.logback.classic.joran.JoranConfigurator | |
ch.qos.logback.classic.LoggerContext | |
org.slf4j.LoggerFactory)) | |
(defn reload-logback | |
[] | |
(let [context ^LoggerContext (LoggerFactory/getILoggerFactory) | |
configurator (JoranConfigurator.) | |
config (io/resource "logback.xml")] | |
(assert config) | |
(.reset context) | |
(.setContext configurator context) | |
(.doConfigure configurator config))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment