remote_syslog 1.6.13 → 1.6.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +53 -4
- data/examples/log_files.yml.example +1 -1
- data/examples/log_files.yml.example.advanced +3 -2
- data/lib/remote_syslog.rb +1 -1
- data/lib/remote_syslog/agent.rb +1 -1
- data/remote_syslog.gemspec +2 -2
- metadata +3 -3
data/README.md
CHANGED
@@ -92,11 +92,14 @@ run in the background):
|
|
92
92
|
|
93
93
|
## Auto-starting at boot
|
94
94
|
|
95
|
-
The gem includes sample [init files]
|
96
|
-
daemonize by default. You may be able to:
|
95
|
+
The gem includes sample [init files]. You may be able to:
|
97
96
|
|
98
97
|
$ cp examples/remote_syslog.init.d /etc/init.d/remote_syslog
|
99
98
|
|
99
|
+
remote_syslog will daemonize by default.
|
100
|
+
|
101
|
+
Init files: [init.d], [launchd], [supervisor], [upstart]
|
102
|
+
|
100
103
|
## Sending messages securely ##
|
101
104
|
|
102
105
|
If the receiving system supports sending syslog over TCP with TLS, you can
|
@@ -132,6 +135,12 @@ remote_syslog sends the name of the file without a path ("mysqld.log") as
|
|
132
135
|
the syslog tag (program name). RFCs 3164 and 5424 limit the tag to 32
|
133
136
|
characters. Longer filenames are truncated to 32 characters.
|
134
137
|
|
138
|
+
After changing the configuration file, restart `remote_syslog` using the
|
139
|
+
init script or by manually killing and restarting the process. For example:
|
140
|
+
|
141
|
+
/etc/init.d/remote_syslog restart
|
142
|
+
|
143
|
+
|
135
144
|
## Advanced Configuration (Optional)
|
136
145
|
|
137
146
|
Here's an [advanced config] which uses all options.
|
@@ -163,7 +172,11 @@ Provide a client certificate when connecting via TLS:
|
|
163
172
|
remote_syslog automatically detects and activates new log files that match
|
164
173
|
its file specifiers. For example, `*.log` may be provided as a file specifier,
|
165
174
|
and remote_syslog will detect a `some.log` file created after it was started.
|
166
|
-
Globs are re-checked every
|
175
|
+
Globs are re-checked every 10 seconds. Ruby's `Dir.glob` is used.
|
176
|
+
|
177
|
+
Note: messages may be written to files in the 0-10 seconds between when the
|
178
|
+
file is created and when the periodic glob check detects it. This data is not
|
179
|
+
currently acted on, though the default behavior may change in the future.
|
167
180
|
|
168
181
|
Also, explicitly-provided filenames need not exist when `remote_syslog` is
|
169
182
|
started. `remote_syslog` can be pre-configured to monitor log files which are
|
@@ -175,6 +188,21 @@ than the current set of matches). This is not necessary for globs defined in
|
|
175
188
|
the config file.
|
176
189
|
|
177
190
|
|
191
|
+
### Log rotation
|
192
|
+
|
193
|
+
External log rotation scripts often move or remove an existing log file
|
194
|
+
and replace it with a new one (at a new inode). The Linux standard script
|
195
|
+
[logrotate](http://iain.cx/src/logrotate/) supports a `copytruncate` config
|
196
|
+
option. With that option, `logrotate` will copy files, operate on the copies,
|
197
|
+
and truncate the original so that the inode remains the same.
|
198
|
+
|
199
|
+
This comes closest to ensuring that programs watching these files (including
|
200
|
+
`remote_syslog`) will not be affected by, or need to be notified of, the
|
201
|
+
rotation. The only tradeoff of `copytruncate` is slightly higher disk usage
|
202
|
+
during rotation, so we recommend this option whether or not you use
|
203
|
+
`remote_syslog`.
|
204
|
+
|
205
|
+
|
178
206
|
### Excluding files from being sent
|
179
207
|
|
180
208
|
Provide one or more regular expressions to prevent certain files from being
|
@@ -284,6 +312,24 @@ symbolic link to the generically-named file:
|
|
284
312
|
Point remote_syslog at unique_name.log. It will use that as the program name.
|
285
313
|
|
286
314
|
|
315
|
+
## Troubleshooting
|
316
|
+
|
317
|
+
Two commands are particularly useful for observing `remote_syslog`
|
318
|
+
behavior. First, its own debugging:
|
319
|
+
|
320
|
+
remote_syslog --debug-level DEBUG --debug-log remote_syslog.log
|
321
|
+
|
322
|
+
This will write internal operations to the file `remote_syslog.log`.
|
323
|
+
|
324
|
+
Second, strace or ktrace shows the interaction between `remote_syslog`
|
325
|
+
and the OS. To run `strace` against an existing `remote_syslog` instance
|
326
|
+
(process ID 12345):
|
327
|
+
|
328
|
+
strace -fp 12345 -s 500
|
329
|
+
|
330
|
+
Feel free to ask questions or report bugs.
|
331
|
+
|
332
|
+
|
287
333
|
## Reporting bugs
|
288
334
|
|
289
335
|
1. See whether the issue has already been reported: <https://github.com/papertrail/remote_syslog/issues/>
|
@@ -303,7 +349,10 @@ Once you've made your great commits:
|
|
303
349
|
|
304
350
|
[sample config]: https://github.com/papertrail/remote_syslog/blob/master/examples/log_files.yml.example
|
305
351
|
[init files]: https://github.com/papertrail/remote_syslog/blob/master/examples/
|
306
|
-
[
|
352
|
+
[init.d]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.init.d
|
353
|
+
[launchd]: https://github.com/papertrail/remote_syslog/blob/master/examples/com.papertrailapp.remote_syslog.plist
|
354
|
+
[supervisor]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.supervisor.conf
|
355
|
+
[upstart]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.upstart.conf
|
307
356
|
[advanced config]: https://github.com/papertrail/remote_syslog/blob/master/examples/log_files.yml.example.advanced
|
308
357
|
[fk]: http://help.github.com/forking/
|
309
358
|
[is]: https://github.com/papertrail/remote_syslog/issues/
|
@@ -1,8 +1,9 @@
|
|
1
|
-
# see README - demonstrates all optional arguments and
|
1
|
+
# see README - demonstrates all optional arguments and more glob formats
|
2
2
|
files:
|
3
3
|
- /var/log/httpd/access_log
|
4
4
|
- /var/log/httpd/error_log
|
5
5
|
- /opt/misc/*.log
|
6
|
+
- /home/**/*.log
|
6
7
|
- /var/log/mysqld.log
|
7
8
|
- /var/run/mysqld/mysqld-slow.log
|
8
9
|
hostname: www42 # override OS hostname
|
@@ -13,4 +14,4 @@ exclude_patterns:
|
|
13
14
|
- \d+ things
|
14
15
|
destination:
|
15
16
|
host: logs.papertrailapp.com
|
16
|
-
port: 12345 #
|
17
|
+
port: 12345 # Papertrail dest port (default: 514)¬
|
data/lib/remote_syslog.rb
CHANGED
data/lib/remote_syslog/agent.rb
CHANGED
data/remote_syslog.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
## If your rubyforge_project name is different, then edit it and comment out
|
9
9
|
## the sub! line in the Rakefile
|
10
10
|
s.name = 'remote_syslog'
|
11
|
-
s.version = '1.6.
|
12
|
-
s.date = '2013-
|
11
|
+
s.version = '1.6.14'
|
12
|
+
s.date = '2013-04-18'
|
13
13
|
s.rubyforge_project = 'remote_syslog'
|
14
14
|
|
15
15
|
## Make sure your summary is short. The description may be as long
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 1.6.
|
8
|
+
- 14
|
9
|
+
version: 1.6.14
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Troy Davis
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-04-18 00:00:00 -07:00
|
19
19
|
default_executable: remote_syslog
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|