remote_syslog 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +27 -17
- data/bin/remote_syslog +2 -5
- data/examples/log_files.yml.example +1 -1
- data/lib/remote_syslog.rb +1 -1
- data/remote_syslog.gemspec +2 -3
- metadata +4 -5
- data/Gemfile.lock +0 -14
data/README.md
CHANGED
@@ -24,7 +24,7 @@ transmitting to any syslog server.
|
|
24
24
|
|
25
25
|
Install the gem, which includes a binary called "remote_syslog":
|
26
26
|
|
27
|
-
gem install remote_syslog
|
27
|
+
$ [sudo] gem install remote_syslog
|
28
28
|
|
29
29
|
Optionally, create a log_files.yml with the log file paths to read and the
|
30
30
|
host/port to log to (see examples/log_files.yml.example). These can also be
|
@@ -53,44 +53,54 @@ specified as arguments to the remote_syslog daemon. More below.
|
|
53
53
|
|
54
54
|
Daemonize, collecting from files mentioned in ./config/logs.yml as well as
|
55
55
|
/var/log/mysqld.log:
|
56
|
-
remote_syslog -c configs/logs.yml -p 12345 /var/log/mysqld.log
|
56
|
+
$ remote_syslog -c configs/logs.yml -p 12345 /var/log/mysqld.log
|
57
57
|
|
58
58
|
Stay attached to the terminal, look for and use /etc/log_files.yml if it exists,
|
59
59
|
write PID to /tmp/remote_syslog.pid, and send with facility local0:
|
60
|
-
remote_syslog -d a.server.com -f local0 -P /tmp /var/log/mysqld.log
|
60
|
+
$ remote_syslog -d a.server.com -f local0 -P /tmp /var/log/mysqld.log
|
61
61
|
|
62
62
|
remote_syslog will daemonize by default. A sample init file is in the gem as
|
63
63
|
remote_syslog.init.d. You may be able to:
|
64
|
-
cp examples/remote_syslog.init.d /etc/init.d/remote_syslog
|
64
|
+
$ cp examples/remote_syslog.init.d /etc/init.d/remote_syslog
|
65
65
|
|
66
66
|
|
67
67
|
## Configuration
|
68
68
|
|
69
|
+
By default, the gem looks for a configuration in /etc/log_files.yml.
|
70
|
+
|
69
71
|
The gem comes with a sample config. Optionally:
|
70
72
|
|
71
|
-
cp examples/log_files.yml.example /etc/log_files.yml
|
73
|
+
$ cp examples/log_files.yml.example /etc/log_files.yml
|
72
74
|
|
73
75
|
log_files.yml has filenames to log from (as an array) and hostname and port
|
74
76
|
to log to (as a hash). Only 1 destination server is supported; the command-line
|
75
77
|
argument wins. Filenames given on the command line are additive to those
|
76
78
|
in the config file.
|
77
79
|
|
80
|
+
files: [/var/log/httpd/access_log, /var/log/httpd/error_log, /var/log/mysqld.log, /var/run/mysqld/mysqld-slow.log]
|
81
|
+
destination:
|
82
|
+
host: logs.papertrailapp.com
|
83
|
+
port: 12345
|
84
|
+
|
78
85
|
|
79
|
-
##
|
86
|
+
## Reporting bugs
|
80
87
|
|
81
|
-
Bug report:
|
82
88
|
|
83
|
-
1. See whether the issue has already been reported:
|
84
|
-
http://github.com/papertrail/remote_syslog/issues/
|
89
|
+
1. See whether the issue has already been reported: <https://github.com/papertrail/remote_syslog/issues/>
|
85
90
|
2. If you don't find one, create an issue with a repro case.
|
86
91
|
|
87
|
-
Enhancement or fix:
|
88
92
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
93
|
+
## Contributing
|
94
|
+
|
95
|
+
Once you've made your great commits:
|
96
|
+
|
97
|
+
1. [Fork][fk] remote_syslog
|
98
|
+
2. Create a topic branch - `git checkout -b my_branch`
|
99
|
+
3. Commit the changes without changing the Rakefile or other files unrelated to your enhancement.
|
100
|
+
4. Push to your branch - `git push origin my_branch`
|
101
|
+
5. Create a Pull Request or an [Issue][is] with a link to your branch
|
102
|
+
6. That's it!
|
95
103
|
|
96
|
-
[
|
104
|
+
[fk]: http://help.github.com/forking/
|
105
|
+
[is]: https://github.com/papertrail/remote_syslog/issues/
|
106
|
+
[Papertrail]: http://papertrailapp.com/
|
data/bin/remote_syslog
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
|
6
3
|
require 'optparse'
|
7
4
|
require 'yaml'
|
8
5
|
require 'pathname'
|
@@ -90,8 +87,8 @@ def remote_syslog_daemon(args)
|
|
90
87
|
exit
|
91
88
|
end
|
92
89
|
|
93
|
-
# handle relative paths before Daemonize changes the wd to /
|
94
|
-
files.map
|
90
|
+
# handle relative paths before Daemonize changes the wd to / and expand wildcards
|
91
|
+
files = files.map { |f| Dir.glob(f) }.flatten.map { |f| File.expand_path(f) }.uniq
|
95
92
|
|
96
93
|
Daemons.run_proc(daemonize_options[:app_name], daemonize_options) do
|
97
94
|
EventMachine.run do
|
data/lib/remote_syslog.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 = '
|
12
|
-
s.date = '
|
11
|
+
s.version = '1.0.0'
|
12
|
+
s.date = '2011-03-22'
|
13
13
|
s.rubyforge_project = 'remote_syslog'
|
14
14
|
|
15
15
|
## Make sure your summary is short. The description may be as long
|
@@ -58,7 +58,6 @@ Gem::Specification.new do |s|
|
|
58
58
|
# = MANIFEST =
|
59
59
|
s.files = %w[
|
60
60
|
Gemfile
|
61
|
-
Gemfile.lock
|
62
61
|
LICENSE
|
63
62
|
README.md
|
64
63
|
Rakefile
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote_syslog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
-
- 0
|
8
7
|
- 1
|
9
8
|
- 0
|
10
|
-
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Papertrail
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-03-22 00:00:00 -07:00
|
19
19
|
default_executable: remote_syslog
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -71,7 +71,6 @@ extra_rdoc_files:
|
|
71
71
|
- LICENSE
|
72
72
|
files:
|
73
73
|
- Gemfile
|
74
|
-
- Gemfile.lock
|
75
74
|
- LICENSE
|
76
75
|
- README.md
|
77
76
|
- Rakefile
|