Skip to content

Instantly share code, notes, and snippets.

@nicolaferraro
Created May 7, 2015 13:27
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 nicolaferraro/b39df5eaeb939e87aa54 to your computer and use it in GitHub Desktop.
Save nicolaferraro/b39df5eaeb939e87aa54 to your computer and use it in GitHub Desktop.
Streaming print
def setStreamingLogLevels() {
val log4jInitialized = Logger.getRootLogger.getAllAppenders.hasMoreElements
if (!log4jInitialized) {
// We first log something to initialize Spark's default logging, then we override the
// logging level.
logInfo("Setting log level to [WARN] for streaming example." +
" To override add a custom log4j.properties to the classpath.")
Logger.getRootLogger.setLevel(Level.WARN)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment