remote_syslog 0.1.0 → 1.0.0

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 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
- ## Contribute
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
- 1. Fork the project:
90
- http://github.com/papertrail/remote_syslog
91
- 2. Make your changes with tests.
92
- 3. Commit the changes without changing the Rakefile or other files unrelated
93
- to your enhancement.
94
- 4. Send a pull request.
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
- [Papertrail]: http://papertrailapp.com/
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! { |f| File.expand_path(f) }
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
@@ -1,4 +1,4 @@
1
1
  files: [/var/log/httpd/access_log, /var/log/httpd/error_log, /var/log/mysqld.log, /var/run/mysqld/mysqld-slow.log]
2
2
  destination:
3
3
  host: logs.papertrailapp.com
4
- port: 12345
4
+ port: 12345 # optional, defaults to 514
data/lib/remote_syslog.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module RemoteSyslog
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
4
4
 
5
5
  require 'remote_syslog/levels'
@@ -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 = '0.1.0'
12
- s.date = '2010-12-17'
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: 27
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
- - 0
8
7
  - 1
9
8
  - 0
10
- version: 0.1.0
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: 2010-12-17 00:00:00 -08:00
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
data/Gemfile.lock DELETED
@@ -1,14 +0,0 @@
1
- GEM
2
- specs:
3
- daemons (1.1.0)
4
- eventmachine (0.12.10)
5
- eventmachine-tail (0.5.20101005181243)
6
- eventmachine
7
-
8
- PLATFORMS
9
- ruby
10
-
11
- DEPENDENCIES
12
- daemons
13
- eventmachine
14
- eventmachine-tail