Last active
August 30, 2020 21:42
-
-
Save jodersky/90ac3fd29b831ce70253f74a6ae59198 to your computer and use it in GitHub Desktop.
Remove useless startup logs from jboss when starting cask
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
def silenceJboss(): Unit = { | |
// Some jboss classes don't have manners and think that it's ok to write to | |
// logs from their static initializers. This is a hack to silence this | |
// rather rude behaviour. | |
val tmp = System.out | |
System.setOut(null) | |
org.jboss.threads.Version.getVersionString() // this causes the static initializer to be run | |
System.setOut(tmp) | |
// Other loggers print way too much information. Set them to only print | |
// interesting stuff. | |
val level = java.util.logging.Level.WARNING | |
java.util.logging.Logger.getLogger("org.jboss").setLevel(level) | |
java.util.logging.Logger.getLogger("org.xnio").setLevel(level) | |
java.util.logging.Logger.getLogger("io.undertow").setLevel(level) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment