logjam_agent 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/logjam_agent.rb +6 -0
- data/lib/logjam_agent/railtie.rb +4 -2
- data/lib/logjam_agent/version.rb +1 -1
- data/logjam_agent.gemspec +1 -1
- metadata +10 -12
data/lib/logjam_agent.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require "socket"
|
2
2
|
require "uuid4r"
|
3
|
+
require "time_bandits"
|
4
|
+
|
3
5
|
require "logjam_agent/version"
|
4
6
|
require "logjam_agent/amqp_forwarder"
|
5
7
|
require "logjam_agent/forwarders"
|
@@ -7,6 +9,10 @@ require "logjam_agent/request"
|
|
7
9
|
require "logjam_agent/buffered_logger"
|
8
10
|
require "logjam_agent/syslog_like_formatter"
|
9
11
|
|
12
|
+
if defined?(Rails) && Rails::VERSION::STRING >= "3.0"
|
13
|
+
require "logjam_agent/railtie"
|
14
|
+
end
|
15
|
+
|
10
16
|
module LogjamAgent
|
11
17
|
|
12
18
|
class ForwardingError < StandardError; end
|
data/lib/logjam_agent/railtie.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'logjam_agent'
|
2
|
+
|
2
3
|
module LogjamAgent
|
3
4
|
|
4
5
|
module Rack
|
@@ -11,11 +12,12 @@ module LogjamAgent
|
|
11
12
|
initializer "initialize_logjam_agent_logger", :before => :initialize_logger do |app|
|
12
13
|
Rails.logger ||= app.config.logger ||
|
13
14
|
begin
|
15
|
+
rails_version = Rails::VERSION::STRING
|
14
16
|
paths = app.config.paths
|
15
|
-
path = (
|
17
|
+
path = (rails_version < "3.2" ? paths.log.to_a : paths['log']).first.to_s
|
16
18
|
logger = LogjamAgent::BufferedLogger.new(path)
|
17
19
|
logger.level = ActiveSupport::BufferedLogger.const_get(app.config.log_level.to_s.upcase)
|
18
|
-
logger.auto_flushing = false if Rails.env.production? &&
|
20
|
+
logger.auto_flushing = false if Rails.env.production? && rails_version < "3.2"
|
19
21
|
logger
|
20
22
|
rescue StandardError => e
|
21
23
|
logger = LogjamAgent::BufferedLogger.new(STDERR)
|
data/lib/logjam_agent/version.rb
CHANGED
data/logjam_agent.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logjam_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 13
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stefan Kaes
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-04
|
19
|
-
default_executable:
|
18
|
+
date: 2012-05-04 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: rake
|
@@ -82,12 +81,12 @@ dependencies:
|
|
82
81
|
requirements:
|
83
82
|
- - ">="
|
84
83
|
- !ruby/object:Gem::Version
|
85
|
-
hash:
|
84
|
+
hash: 19
|
86
85
|
segments:
|
87
86
|
- 0
|
88
|
-
-
|
89
|
-
-
|
90
|
-
version: 0.
|
87
|
+
- 2
|
88
|
+
- 2
|
89
|
+
version: 0.2.2
|
91
90
|
type: :runtime
|
92
91
|
version_requirements: *id005
|
93
92
|
description: Logjam logger and request information forwarding
|
@@ -117,7 +116,6 @@ files:
|
|
117
116
|
- lib/logjam_agent/version.rb
|
118
117
|
- logjam_agent.gemspec
|
119
118
|
- rails/init.rb
|
120
|
-
has_rdoc: true
|
121
119
|
homepage: ""
|
122
120
|
licenses: []
|
123
121
|
|
@@ -147,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
145
|
requirements: []
|
148
146
|
|
149
147
|
rubyforge_project: logjam_agent
|
150
|
-
rubygems_version: 1.
|
148
|
+
rubygems_version: 1.8.21
|
151
149
|
signing_key:
|
152
150
|
specification_version: 3
|
153
151
|
summary: Logjam client library to be used with logjam
|