gray_logger 0.9.1 → 0.9.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.
- data/README.md +14 -10
- metadata +3 -3
data/README.md
CHANGED
@@ -13,16 +13,7 @@ GrayLogger is a small logging tool that allows you to simply log anything you wa
|
|
13
13
|
gem "gray_logger"
|
14
14
|
```
|
15
15
|
|
16
|
-
2.
|
17
|
-
```shell
|
18
|
-
rails g gray_logger:install
|
19
|
-
```
|
20
|
-
or if you are using Rails 2.3.x
|
21
|
-
```shell
|
22
|
-
script/generate gray_logger:install
|
23
|
-
```
|
24
|
-
|
25
|
-
3. configure GrayLogger in config/gray_logger.yml
|
16
|
+
2. configure GrayLogger in config/gray_logger.yml
|
26
17
|
```yaml
|
27
18
|
development:
|
28
19
|
host: 127.0.0.1
|
@@ -30,6 +21,19 @@ GrayLogger is a small logging tool that allows you to simply log anything you wa
|
|
30
21
|
facility: "myapp"
|
31
22
|
```
|
32
23
|
|
24
|
+
3. if you are using Rails 2.3 please add the following code to an initializer:
|
25
|
+
```ruby
|
26
|
+
require 'gray_logger'
|
27
|
+
begin
|
28
|
+
gray_logger_config = YAML.load(File.read(Rails.root.join("config/gray_logger.yml")))[Rails.env]
|
29
|
+
Rails.configuration.middleware.insert_after Rack::Lock, "GrayLogger::Middleware", :configuration => gray_logger_config
|
30
|
+
rescue => e
|
31
|
+
$stderr.puts("GrayLogger not configured. Please add config/gray_logger.yml")
|
32
|
+
end
|
33
|
+
|
34
|
+
ActionController::Base.send(:include, ::GrayLogger::HelperMethods)
|
35
|
+
````
|
36
|
+
|
33
37
|
## Usage
|
34
38
|
|
35
39
|
In Rails you can use the "gray_logger" method to add new fields to be logged to Graylog2.
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gray_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 2
|
10
|
+
version: 0.9.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Benjamin Behr
|