Skip to content

Instantly share code, notes, and snippets.

@mbonaci
Created February 28, 2015 14:16
Show Gist options
  • Save mbonaci/e92a2bc690e002f461c1 to your computer and use it in GitHub Desktop.
Save mbonaci/e92a2bc690e002f461c1 to your computer and use it in GitHub Desktop.
log4j.properties: ERRORs to the console, INFO to a file (Spark)
# Set everything to be logged to the console
log4j.rootCategory=INFO, console, file
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.threshold=ERROR
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/home/mbo/Spark/logging.log
log4j.appender.file.MaxFileSize=5MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
# Settings to quiet third party logs that are too verbose
log4j.logger.org.eclipse.jetty=WARN
log4j.logger.org.eclipse.jetty.util.component.AbstractLifeCycle=ERROR
log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO
log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO
@blacknred0
Copy link

thanks for the share!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment