Dzahn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316517

Change subject: gerrit: log4j config to log to files
......................................................................

gerrit: log4j config to log to files

In Ie0c4c0aa202574743 we introduced the log4j config snippet
from upstream, in order to later send it to logstash
in T141324, but since that is not done yet and we did not
define a FileAppender we did not have any logs.

So for now, make log4j log to local files.

Change-Id: Id15568b49fce5db9ed55fd72cffdd9a2b4366182
---
M modules/gerrit/templates/log4j.properties.erb
1 file changed, 42 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/17/316517/1

diff --git a/modules/gerrit/templates/log4j.properties.erb 
b/modules/gerrit/templates/log4j.properties.erb
index 7e24cdc..fe3ba12 100644
--- a/modules/gerrit/templates/log4j.properties.erb
+++ b/modules/gerrit/templates/log4j.properties.erb
@@ -15,11 +15,47 @@
 
 monitorInterval=60
 
-log4j.rootCategory=INFO, stderr
-log4j.appender.stderr=org.apache.log4j.ConsoleAppender
-log4j.appender.stderr.target=System.err
-log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
-log4j.appender.stderr.layout.ConversionPattern=[%d] [%t] %-5p %c %x: %m%n
+log4j.rootLogger=DEBUG, error_log
+log4j.logger.com.google.gerrit.sshd.SshLog=DEBUG, sshd_log
+log4j.logger.com.google.gerrit.pgm.http.jetty.HttpLog=DEBUG, httpd_log
+log4j.logger.gc_log=DEBUG, gc_log
+# Prevent gc_log from outputting to error_log
+log4j.additivity.gc_log=false
+
+# Configure log appenders as defaults
+log4j.appender.error_log=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.error_log.File=/var/log/gerrit/error_log
+log4j.appender.error_log.layout=org.apache.log4j.PatternLayout
+log4j.appender.error_log.layout.ConversionPattern=[%d] %-5p %c %x: %m%n
+log4j.appender.error_log.encoding=UTF-8
+log4j.appender.error_log.threshold=INFO
+log4j.appender.error_log.immediateFlush=true
+log4j.appender.error_log.fileAppend=true
+log4j.appender.httpd_log=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.httpd_log.File=/var/log/gerrit/httpd_log
+log4j.appender.httpd_log.layout=com.google.gerrit.pgm.http.jetty.HttpLogLayout
+log4j.appender.httpd_log.encoding=UTF-8
+log4j.appender.httpd_log.threshold=INFO
+log4j.appender.httpd_log.immediateFlush=true
+log4j.appender.httpd_log.fileAppend=true
+log4j.appender.sshd_log=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.sshd_log.File=/var/log/gerrit/sshd_log
+log4j.appender.sshd_log.layout=com.google.gerrit.sshd.SshLogLayout
+log4j.appender.sshd_log.encoding=UTF-8
+log4j.appender.sshd_log.threshold=INFO
+log4j.appender.sshd_log.immediateFlush=true
+log4j.appender.sshd_log.fileAppend=true
+log4j.appender.gc_log=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.gc_log.File=/var/log/gerrit/gc_log
+log4j.appender.gc_log.layout=org.apache.log4j.PatternLayout
+log4j.appender.gc_log.layout.ConversionPattern=[%d] %-5p %x: %m%n
+log4j.appender.gc_log.encoding=UTF-8
+log4j.appender.gc_log.threshold=INFO
+log4j.appender.gc_log.immediateFlush=true
+log4j.appender.gc_log.fileAppend=true
+
+log4j.logger.com.google.gerrit=INFO
+
 
 # Silence non-critical messages from MINA SSHD.
 #
@@ -54,7 +90,7 @@
 log4j.logger.velocity=WARN
 
 # Silence non-critical messages from apache.http
-log4j.logger.org.apache.http=WARN
+# log4j.logger.org.apache.http=WARN
 
 # Silence non-fatal messages from cookie parsing
 log4j.logger.org.apache.http.client.protocol.ResponseProcessCookies=FATAL

-- 
To view, visit https://gerrit.wikimedia.org/r/316517
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id15568b49fce5db9ed55fd72cffdd9a2b4366182
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <dz...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to