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.
@@ -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
@@ -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 = (paths.respond_to?(:log) ? paths.log.to_a : paths['log']).first.to_s
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? && Rails::VERSION::STRING < "3.2"
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)
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -23,5 +23,5 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.add_runtime_dependency "activesupport"
25
25
  s.add_runtime_dependency "uuid4r"
26
- s.add_runtime_dependency "time_bandits", [">= 0.1.1"]
26
+ s.add_runtime_dependency "time_bandits", [">= 0.2.2"]
27
27
  end
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: 15
5
- prerelease: false
4
+ hash: 13
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
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-05 00:00:00 +02:00
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: 25
84
+ hash: 19
86
85
  segments:
87
86
  - 0
88
- - 1
89
- - 1
90
- version: 0.1.1
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.3.7
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