Created
November 24, 2022 15:43
-
-
Save vrdhn/aa021b2ec8996d194cfc1debf9628ea7 to your computer and use it in GitHub Desktop.
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
implementation("org.apache.logging.log4j:log4j-api:2.19.0") | |
implementation("org.apache.logging.log4j:log4j-core:2.19.0") | |
private static final Logger LOG = LogManager.getLogger(Main.class); | |
private static void setLogLevel(Level level) { | |
LoggerContext ctx = (LoggerContext) LogManager.getContext(false); | |
LoggerConfig loggerConfig = ctx.getConfiguration().getLoggerConfig(LogManager.ROOT_LOGGER_NAME); | |
loggerConfig.setLevel(level); | |
ctx.updateLoggers(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment