Merge lp:~wallyworld/juju-core/rsyslog-stutter into lp:~go-bot/juju-core/trunk
Status: | Merged |
---|---|
Approved by: | Ian Booth |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1372 |
Proposed branch: | lp:~wallyworld/juju-core/rsyslog-stutter |
Merge into: | lp:~go-bot/juju-core/trunk |
Diff against target: |
121 lines (+20/-5) 4 files modified
environs/cloudinit/cloudinit_test.go (+4/-4) log/syslog/config.go (+9/-0) log/syslog/config_test.go (+4/-0) worker/deployer/simple_test.go (+3/-1) |
To merge this branch: | bzr merge lp:~wallyworld/juju-core/rsyslog-stutter |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+172268@code.launchpad.net |
Commit message
Fix rsyslog stutter issue
Bug 1195223 said that rsyslog was writing repetitive
information to the all-machines log file. Extra rsyslog
config is added to specify the use of an explicit state
file which rsyslog uses to keep track of where it is up
to when tailing files to be logged.
I tested live on EC2 and after 30 minutes and deploying
a mysql charm, the all machines log was about 80k and
did not contain duplicate logged items.
Description of the change
Fix rsyslog stutter issue
Bug 1195223 said that rsyslog was writing repetitive
information to the all-machines log file. Extra rsyslog
config is added to specify the use of an explicit state
file which rsyslog uses to keep track of where it is up
to when tailing files to be logged.
I tested live on EC2 and after 30 minutes and deploying
a mysql charm, the all machines log was about 80k and
did not contain duplicate logged items.
Reviewers: mp+172268_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix rsyslog stutter issue
Bug 1195223 said that rsyslog was writing repetitive
information to the all-machines log file. Extra rsyslog
config is added to specify the use of an explicit state
file which rsyslog uses to keep track of where it is up
to when tailing files to be logged.
I tested live on EC2 and after 30 minutes and deploying
a mysql charm, the all machines log was about 80k and
did not contain duplicate logged items.
https:/ /code.launchpad .net/~wallyworl d/juju- core/rsyslog- stutter/ +merge/ 172268
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/10820043/
Affected files: config. go config_ test.go
A [revision details]
M log/syslog/
M log/syslog/
Index: [revision details] 20130701001136- uj4xmbgpnl1rbt9 n
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: log/syslog/ config. go config. go' config. go 2013-05-02 15:55:42 +0000 config. go 2013-07-01 03:03:59 +0000 logTemplate = `
=== modified file 'log/syslog/
--- log/syslog/
+++ log/syslog/
@@ -17,6 +17,8 @@
const stateServerRsys
$ModLoad imfile
+$InputFileStat eFile {{statefilePath}} istStateInterva l 50 lInterval 5 {{logfileName} }:
+$InputFilePers
$InputFilePol
$InputFileName {{logfilePath}}
$InputFileTag local-juju-
@@ -41,6 +43,8 @@
const nodeRsyslogTemplate = `
$ModLoad imfile
+$InputFileStat eFile {{statefilePath}} istStateInterva l 50 lInterval 5 logfileName} }: "/var/log/ juju/%s. log", slConfig. LogFileName)
+$InputFilePers
$InputFilePol
$InputFileName {{logfilePath}}
$InputFileTag juju-{{
@@ -118,10 +122,15 @@
return fmt.Sprintf(
}
+ var stateFilePath = func() string { "/var/spool/ rsyslog/ %s-state" , slConfig. LogFileName) template. FuncMap{ "logfileName" : logFileName}) template. FuncMap{ "bootstrapIP" : bootstrapIP}) template. FuncMap{ "logfilePath" : logFilePath}) template. FuncMap{ "statefilePath" : stateFilePath})
+ return fmt.Sprintf(
+ }
+
t := template.New("")
t.Funcs(
t.Funcs(
t.Funcs(
+ t.Funcs(
// Process the rsyslog config template and echo to the conf file. slConfig. configTemplate)
p, err := t.Parse(
Index: log/syslog/ config_ test.go config_ test.go' config_ test.go 2013-05-02 15:55:42 +0000 config_ test.go 2013-07-01 03:03:59 +0000 ateSyslogConf = `
=== modified file 'log/syslog/
--- log/syslog/
+++ log/syslog/
@@ -41,6 +41,8 @@
var expectedAccumul
$ModLoad imfile
+$InputFileStat eFile /var/spool/ rsyslog/ some-machine- state istStateInterva l 50 lInterval 5 juju/some- machine. log some-machine: SyslogConf = `
+$InputFilePers
$InputFilePol
$InputFileName /var/log/
$InputFileTag local-juju-
@@ -80,6 +82,8 @@
var expectedForward
$ModLoad imfile
+$InputFileStat eFile /var/spool/ rsyslog/ some-machine- state istStateInterva l 50 lInterval 5 juju/some- machine. log
+$InputFilePers
$InputFilePol
$InputFileName /var/log/
$InputFileTag juju-some-machine: