rails-tagged-syslog 0.0.1 → 0.0.2

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +76 -0
  3. data/lib/logger/version.rb +1 -1
  4. metadata +6 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f582a647f5043eeb3e7d7a801c684a3a563ca65
4
- data.tar.gz: 431348f929d03eb88b0eb24a188ef1df952c5973
3
+ metadata.gz: 936464b1e98c852472fb5081f8453369d3165728
4
+ data.tar.gz: b44e53b0066089869ebf253f1469789bbc56eba9
5
5
  SHA512:
6
- metadata.gz: 02d39b3f716fe1809b4ae41f0a08e3468a969a29b767da98c690eb886c47ffc0fd9d495476370c80e1be4cf0b7d346bd780528a7d82c67a87bf136d81862809f
7
- data.tar.gz: 35579f0e62c73eeb23773d3e497051b2ff459dc032b2ce9421fd6b3e54ba1e73a2b917088174ae087cb3eeb0a9b88e8e07a5e5d143ae84e1bafe59e702038970
6
+ metadata.gz: ed1792a8df0fb6c46f8705fd9438afec66ed779978a903a36809f793bfc5b3da16ae8d893c92876cbb13f5da8dc2de1804e8cc2efa55e75848bab30c74e5f3e1
7
+ data.tar.gz: dbd0dbcc52a02c1511e4e4a65e364b1d068b1298db89a051dcddf7b43e0bc1fb0e5dbaf2f61509c1da86eca787eeb827c6564cea6e1a48518923e00c872d2383
data/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # rails-tagged-syslog
2
+ https://github.com/abril/rails-tagged-syslog
3
+
4
+ ## Description
5
+ This is a simple wrapper to integrate Rails Tagged Logging with Syslog, this way you can benefit from rails tagged logging with
6
+ the power provided by the [syslog](http://en.wikipedia.org/wiki/Syslog) system.
7
+
8
+ ## Install
9
+ ````
10
+ $ gem install rails-tagged-syslog
11
+ ````
12
+ or via Gemfile
13
+ ```
14
+ gem 'rails-tagged-syslog'
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ### Rails config
20
+ ```ruby
21
+ config.logger = Abril::TaggedSyslog.new
22
+ ```
23
+ By default it will add the request ID, as a tag, to your logs, but you can also add more tags using the default rails mechanism
24
+ ```ruby
25
+ config.log_tags = [:remote_ip, -> request { request.env['yourapp.someid'] }]
26
+ ```
27
+
28
+ ### Syslog config
29
+
30
+ #### BSD Syslog Setup
31
+
32
+ ##### /etc/syslog.conf
33
+
34
+ Add the following lines:
35
+ ```
36
+ !rails
37
+ *.* /var/log/production.log
38
+ ```
39
+
40
+ Or, in Mac OS X:
41
+ ```
42
+ local7.* /var/log/production.log
43
+ ````
44
+
45
+ Then touch /var/log/production.log and signal syslogd with a HUP
46
+ ```bash
47
+ $ killall -HUP syslogd
48
+ ```
49
+
50
+ ##### /etc/newsyslog.conf
51
+
52
+ Add the following line:
53
+ ```
54
+ /var/log/production.log 640 7 * @T00 Z
55
+ ````
56
+
57
+ This creates a log file that is rotated every day at midnight, gzip'd, then
58
+ kept for 7 days. Consult newsyslog.conf(5) for more details.
59
+
60
+ #### Syslog-ng Setup
61
+
62
+ ##### syslog-ng.conf
63
+
64
+ A basic setup:
65
+ ```
66
+ destination rails_log { file("/var/log/production.log"); };
67
+ filter f_rails { program("rails.*"); };
68
+ log { source(src); filter(f_rails); destination(rails_log); };
69
+ ````
70
+
71
+ A more advanced setup with formatting, etc:
72
+ ```
73
+ destination rails { file("/var/log/rails_apps" owner("rails") group("rails") perm(0664) template("$DATE $HOST $PROGRAM [$LEVEL] $MSGONLY\n") template_escape(no) ); };
74
+ filter f_rails { (program("railsappone") or program("railsapptwo")) and not match("SQL ") and not match("SELECT") and not match("INSERT INTO") and not match("UPDATE"); };
75
+ log { source(src); filter(f_rails); destination(rails); };
76
+ ````
@@ -1,5 +1,5 @@
1
1
  module Abril
2
2
  module TaggedSyslog
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-tagged-syslog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giuliano Melo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-06 00:00:00.000000000 Z
11
+ date: 2015-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: syslog-logger
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 1.6.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 1.6.8
27
27
  description:
28
28
  email: giuliano.melo@abril.com.br
29
29
  executables: []
@@ -31,6 +31,7 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - LICENSE
34
+ - README.md
34
35
  - lib/logger/formatter.rb
35
36
  - lib/logger/railtie.rb
36
37
  - lib/logger/syslogger.rb
@@ -58,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
59
  version: '0'
59
60
  requirements: []
60
61
  rubyforge_project:
61
- rubygems_version: 2.2.2
62
+ rubygems_version: 2.4.6
62
63
  signing_key:
63
64
  specification_version: 4
64
65
  summary: A simple wrapper to use Rails Tagged Logging with Syslog