Skip to content

Instantly share code, notes, and snippets.

@jodersky
Last active August 30, 2020 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jodersky/90ac3fd29b831ce70253f74a6ae59198 to your computer and use it in GitHub Desktop.
Save jodersky/90ac3fd29b831ce70253f74a6ae59198 to your computer and use it in GitHub Desktop.
Remove useless startup logs from jboss when starting cask
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