Created
January 5, 2020 12:37
-
-
Save mikeananev/5aeb6cb0879b75f84c60727f0e3395c2 to your computer and use it in GitHub Desktop.
Programmatic configuration of log4j2
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
(ns user | |
(:import (org.apache.logging.log4j.core.config.builder.api ConfigurationBuilderFactory) | |
(org.apache.logging.log4j.core.config Configurator) | |
(org.apache.logging.log4j Level))) | |
(def builder (ConfigurationBuilderFactory/newConfigurationBuilder)) | |
(def console (.newAppender builder "stdout" "console")) | |
(.add builder console) | |
(Configurator/setRootLevel Level/DEBUG) | |
(println "log4j2 is configured.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment