remote_syslog 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -71,8 +71,10 @@ to `a.server.com:514`:
71
71
 
72
72
  $ remote_syslog -D -d a.server.com -f local0 -P /tmp /var/log/mysqld.log
73
73
 
74
- remote_syslog will daemonize by default. A sample init file is in the gem as
75
- [remote_syslog.init.d]. You may be able to:
74
+ ## Auto-starting at boot
75
+
76
+ The gem includes sample [init files] such as [remote_syslog.init.d]. remote_syslog will
77
+ daemonize by default. You may be able to:
76
78
 
77
79
  $ cp examples/remote_syslog.init.d /etc/init.d/remote_syslog
78
80
 
@@ -234,6 +236,7 @@ Once you've made your great commits:
234
236
  6. That's it!
235
237
 
236
238
  [sample config]: https://github.com/papertrail/remote_syslog/blob/master/examples/log_files.yml.example
239
+ [init files]: https://github.com/papertrail/remote_syslog/blob/master/examples/
237
240
  [remote_syslog.init.d]: https://github.com/papertrail/remote_syslog/blob/master/examples/remote_syslog.init.d
238
241
  [advanced config]: https://github.com/papertrail/remote_syslog/blob/master/examples/log_files.yml.example.advanced
239
242
  [fk]: http://help.github.com/forking/
@@ -3,4 +3,8 @@
3
3
  require 'remote_syslog'
4
4
  require 'remote_syslog/cli'
5
5
 
6
+ EM.error_handler { |e|
7
+ puts "Unhandled Exception: #{e.class}: #{e.message}:\n\t#{e.backtrace.join("\n\t")}"
8
+ }
9
+
6
10
  RemoteSyslog::Cli.process!(ARGV)
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <!-- Put this file in /Library/LaunchDaemons/ -->
4
+ <plist version = "1.0">
5
+ <dict>
6
+ <key>Label</key>
7
+ <string>com.papertrailapp.remote_syslog</string>
8
+ <key>RunAtLoad</key>
9
+ <true/>
10
+ <key>KeepAlive</key>
11
+ <true/>
12
+ <key>UserName</key>
13
+ <string>root</string>
14
+ <key>ProgramArguments</key>
15
+ <array>
16
+ <string>remote_syslog</string>
17
+ <string>-D</string>
18
+ </array>
19
+ </dict>
20
+ </plist>
@@ -1,5 +1,5 @@
1
1
  module RemoteSyslog
2
- VERSION = "1.6.1"
2
+ VERSION = "1.6.2"
3
3
  end
4
4
 
5
5
  require 'remote_syslog/reader'
@@ -4,6 +4,12 @@ require 'eventmachine-tail'
4
4
  require 'em-dns-resolver'
5
5
  require 'syslog_protocol'
6
6
 
7
+ # Force eventmachine-tail not to change the encoding
8
+ # This will allow ruby 1.9 to deal with any file data
9
+ old_verbose, $VERBOSE = $VERBOSE, nil
10
+ EventMachine::FileTail::FORCE_ENCODING = false
11
+ $VERBOSE = old_verbose
12
+
7
13
  module RemoteSyslog
8
14
  class Reader < EventMachine::FileTail
9
15
  COLORED_REGEXP = /\e\[(?:(?:[34][0-7]|[0-9]);){0,2}(?:[34][0-7]|[0-9])m/
@@ -68,5 +74,9 @@ module RemoteSyslog
68
74
 
69
75
  @socket.write(packet.assemble)
70
76
  end
77
+
78
+ def on_exception(exception)
79
+ puts "Exception: #{exception.class}: #{exception.message}\n\t#{exception.backtrace.join("\n\t")}"
80
+ end
71
81
  end
72
82
  end
@@ -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.1'
12
- s.date = '2012-02-03'
11
+ s.version = '1.6.2'
12
+ s.date = '2012-04-05'
13
13
  s.rubyforge_project = 'remote_syslog'
14
14
 
15
15
  ## Make sure your summary is short. The description may be as long
@@ -60,6 +60,7 @@ Gem::Specification.new do |s|
60
60
  README.md
61
61
  Rakefile
62
62
  bin/remote_syslog
63
+ examples/com.papertrailapp.remote_syslog.plist
63
64
  examples/log_files.yml.example
64
65
  examples/log_files.yml.example.advanced
65
66
  examples/remote_syslog.init.d
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_syslog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-02-03 00:00:00.000000000Z
13
+ date: 2012-04-05 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: daemons
17
- requirement: &70277515640720 !ruby/object:Gem::Requirement
17
+ requirement: &70360105662380 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70277515640720
25
+ version_requirements: *70360105662380
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: eventmachine
28
- requirement: &70277515640160 !ruby/object:Gem::Requirement
28
+ requirement: &70360105686880 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 0.12.10
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70277515640160
36
+ version_requirements: *70360105686880
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: eventmachine-tail
39
- requirement: &70277515656100 !ruby/object:Gem::Requirement
39
+ requirement: &70360105686460 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '0'
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70277515656100
47
+ version_requirements: *70360105686460
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: syslog_protocol
50
- requirement: &70277515655540 !ruby/object:Gem::Requirement
50
+ requirement: &70360105685900 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 0.9.1
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *70277515655540
58
+ version_requirements: *70360105685900
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: em-resolv-replace
61
- requirement: &70277515655120 !ruby/object:Gem::Requirement
61
+ requirement: &70360105685480 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0'
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *70277515655120
69
+ version_requirements: *70360105685480
70
70
  description: Lightweight daemon to tail one or more log files and transmit UDP syslog
71
71
  messages to a remote syslog host (centralized log aggregation). Generates UDP packets
72
72
  itself instead of depending on a system syslog daemon, so it doesn't affect system-wide
@@ -86,6 +86,7 @@ files:
86
86
  - README.md
87
87
  - Rakefile
88
88
  - bin/remote_syslog
89
+ - examples/com.papertrailapp.remote_syslog.plist
89
90
  - examples/log_files.yml.example
90
91
  - examples/log_files.yml.example.advanced
91
92
  - examples/remote_syslog.init.d