[MediaWiki-commits] [Gerrit] operations/puppet[production]: Gerrit: Fix up logstash configuation

2017-11-21 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/392079 )

Change subject: Gerrit: Fix up logstash configuation
..


Gerrit: Fix up logstash configuation

Switch to using socket instead of tcp.

Using socket over tcp works. Logstash side can parse the info it gets.

Tested locally on:

http://gerrit-logstash.wmflabs.org/

Also switch from properties syntax to xml syntax.

xml log4j syntax has more advanced features which we want to use.

Also include configuation updates to improve the logging.

As it was logging alot of useless things.

Also we have to make sure gc_log and sshd_log and error_log are created
now as gerrit was prevously doing that in java, but some how using a
custom log4j file disables it gerrit's side so log4j will throw a
error but gerrit will still start, it just wont log.

Also use java_options from jetty.pp which will allow us to define
the command once in puppet and then it's added to gerrit.config and
gerrit.service thus making the files look pretty as they wont have long
lines

Bug: T141324
Change-Id: I76245284285c6eb2377df23f1a75284dc0616d36
---
M modules/gerrit/manifests/jetty.pp
M modules/gerrit/templates/initscripts/gerrit.systemd.erb
D modules/gerrit/templates/log4j.properties.erb
A modules/gerrit/templates/log4j.xml.erb
4 files changed, 189 insertions(+), 110 deletions(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/gerrit/manifests/jetty.pp 
b/modules/gerrit/manifests/jetty.pp
index e4e7d40..dc35759 100644
--- a/modules/gerrit/manifests/jetty.pp
+++ b/modules/gerrit/manifests/jetty.pp
@@ -52,6 +52,8 @@
 $ldap_proxyagent_pass = $ldapconfig['proxypass']
 
 $java_options = [
+"-Xmx${heap_limit} -Xms${heap_limit}",
+
'-Dlog4j.configuration=file:///var/lib/gerrit2/review_site/etc/log4j.xml',
 # These settings apart from the bottom control logging for gc
 # '-Xloggc:/srv/gerrit/jvmlogs/jvm_gc.%p.log',
 # '-XX:+PrintGCApplicationStoppedTime',
@@ -62,7 +64,6 @@
 # '-XX:+UseGCLogFileRotation',
 # '-XX:NumberOfGCLogFiles=10',
 # '-XX:GCLogFileSize=2M',
-# 
'-Dlog4j.configuration=file:///var/lib/gerrit2/review_site/etc/log4j.properties',
 ]
 
 require_package([
@@ -245,8 +246,8 @@
 require => File['/var/lib/gerrit2/review_site/etc'],
 }
 
-file { '/var/lib/gerrit2/review_site/etc/log4j.properties':
-content => template('gerrit/log4j.properties.erb'),
+file { '/var/lib/gerrit2/review_site/etc/log4j.xml':
+content => template('gerrit/log4j.xml.erb'),
 owner   => 'gerrit2',
 group   => 'gerrit2',
 mode=> '0444',
@@ -277,6 +278,13 @@
 require => File['/var/lib/gerrit2/review_site/etc'],
 }
 
+file { '/var/lib/gerrit2/review_site/logs':
+ensure => directory,
+owner  => 'gerrit2',
+group  => 'gerrit2',
+mode   => '0755',
+}
+
 file { '/var/lib/gerrit2/review_site/static':
 ensure  => directory,
 recurse => remote,
@@ -284,6 +292,7 @@
 group   => 'gerrit2',
 mode=> '0444',
 source  => 'puppet:///modules/gerrit/static',
+require => File['/var/lib/gerrit2/review_site'],
 }
 
 file { '/var/lib/gerrit2/review_site/plugins':
diff --git a/modules/gerrit/templates/initscripts/gerrit.systemd.erb 
b/modules/gerrit/templates/initscripts/gerrit.systemd.erb
index 13e2b3a..9860c60 100644
--- a/modules/gerrit/templates/initscripts/gerrit.systemd.erb
+++ b/modules/gerrit/templates/initscripts/gerrit.systemd.erb
@@ -7,7 +7,7 @@
 Group=gerrit2
 Type=simple
 EnvironmentFile=/etc/default/gerrit
-ExecStart=<%= @java_home %>/bin/java -Xmx<%= @heap_limit %> -Xms<%= 
@heap_limit %> -jar /var/lib/gerrit2/review_site/bin/gerrit.war daemon -d 
/var/lib/gerrit2/review_site<%- if @slave -%> --slave<% end %>
+ExecStart=<%= @java_home %>/bin/java <% @java_options.each do |jvm_opt| %><%= 
jvm_opt %> <% end %> -jar /var/lib/gerrit2/review_site/bin/gerrit.war daemon -d 
/var/lib/gerrit2/review_site<%- if @slave -%> --slave<% end %>
 KillSignal=SIGINT
 # NOFILE :  GERRIT_FDS, determined by "core.packedGitOpenFiles" in the script
 LimitNOFILE=<%= @git_open_files %>
diff --git a/modules/gerrit/templates/log4j.properties.erb 
b/modules/gerrit/templates/log4j.properties.erb
deleted file mode 100644
index 429bba2..000
--- a/modules/gerrit/templates/log4j.properties.erb
+++ /dev/null
@@ -1,106 +0,0 @@
-# Copyright (C) 2008 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Gerrit: Fix up logstash configuation

2017-11-17 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392079 )

Change subject: Gerrit: Fix up logstash configuation
..

Gerrit: Fix up logstash configuation

Switch to using socket instead of tcp.

Using socket over tcp works. Logstash side can parse the info it gets.

Tested locally on:

http://gerrit-logstash.wmflabs.org/

Bug: T141324
Change-Id: I76245284285c6eb2377df23f1a75284dc0616d36
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/79/392079/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76245284285c6eb2377df23f1a75284dc0616d36
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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