logjam_agent 0.8.2 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjI5M2JhYTA2YTQzZGUwNmM2ZmRiOTQ2NmU1MmFmNzRmMWM5ZWE1YQ==
4
+ OGVlMTVjMWMzMTI1YzcxNzM3NTExZTc1MjQ3NmJkOTcxN2VhOTcyYw==
5
5
  data.tar.gz: !binary |-
6
- YjVmYzNjMWYyYTk3ODUwZTgxNTg3ZTExMGQyZjgyNDU3YjVjNDNmMA==
6
+ YWI2N2Q1NTFkOTMxMTRlZWQwMjNlYWVlZGZmZGI1YjhmZGE4NDQwZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDFiNWRlYjMyNWRkYTQ1MjI3YTZlZGI2MDNhMmRjNGU4YWE4NTA0N2NhODY3
10
- YjhhY2M2YWI1OTM1ZGJlMzY3ZjJjZTc2YTEwNThlYzE2Nzg5MzExM2Q0OTVi
11
- NmM2OWZjM2E2MDJjY2E5ZGMwMDE0YzMzZTM3NmViY2JlN2Q1ODY=
9
+ YWEzMTVkNTUyNDUxMTZmZDUyNTY3YTNlMDI2NmI2YzgzMjM1NDI1ZWU0MmEz
10
+ MzdjZTA4ZmVjZTZiNjVkNTliOGU3ZmFhMTEzOTRkNGI1NzYyNmNlNTdkNWYw
11
+ ZTdkNjNjNjdlNWMxMjA4MmYwY2JmYmZmOTdiZGE5ZjAxNGZkMTc=
12
12
  data.tar.gz: !binary |-
13
- ZmExZTkwZDRjNTgyNjYxYjIzMDRmMGY4YWU4ZjQzZWM0MDI5Y2YxNjcxNTMw
14
- NjI3MTlmYmU0ZWNjMWRkNWYxZTYyZGMxOTVkYjEyZmM2NDZhMGQxN2E3OWI0
15
- YmU4ODNhZWM1OGZmNGVmYzM1ZWY3ZjNmY2Q5NTk5NTZhOWNhZTY=
13
+ MDFlYTczMzNjMThlNDlmNTE0OTJmZTdlNzE4MTdmMzQ1OWU0MTRmYmEyODA0
14
+ ODkzOTJjOTZmZTA4NThmZjBkZTk0YjM5ZmRjNTUyNWMwZmNkMDI1OWJlZjM5
15
+ NzYwY2VhMTlhNjQwYTQ5NDUxZTU1MjQ3NjBlNzczZThkM2ZlODM=
@@ -3,6 +3,6 @@
3
3
  Client side library for logjam.
4
4
 
5
5
  Provides a customized logger, which logs lines and sends combined request information via
6
- AMQP to logjam.
6
+ AMQP or ZeroMQ to logjam.
7
7
 
8
8
 
@@ -1,5 +1,4 @@
1
1
  require "socket"
2
- require "uuid4r"
3
2
  require "time_bandits"
4
3
 
5
4
  module LogjamAgent
@@ -119,6 +118,18 @@ module LogjamAgent
119
118
  EOS
120
119
  end
121
120
 
121
+ # setup uuid generation
122
+ begin
123
+ require "uuid4r"
124
+ def self.generate_uuid
125
+ UUID4R::uuid(1).gsub('-','')
126
+ end
127
+ rescue LoadError
128
+ def self.generate_uuid
129
+ SecureRandom.uuid.gsub('-','')
130
+ end
131
+ end
132
+
122
133
  # setup json encoding
123
134
  begin
124
135
  require "oj"
@@ -10,6 +10,7 @@ module LogjamAgent
10
10
  @env = env
11
11
  @config = default_options(app, env).merge!(opts)
12
12
  @exchange = @bunny = nil
13
+ ensure_bunny_gem_is_available
13
14
  end
14
15
 
15
16
  def default_options(app, env)
@@ -88,12 +89,11 @@ module LogjamAgent
88
89
 
89
90
  #TODO: verify socket_timout for ruby 1.9
90
91
  def bunny
91
- @bunny ||=
92
- begin
93
- require "bunny" unless defined?(Bunny)
94
- Bunny.new(:host => @config[:host], :socket_timeout => 1.0)
95
- end
92
+ @bunny ||= Bunny.new(:host => @config[:host], :socket_timeout => 1.0)
96
93
  end
97
94
 
95
+ def ensure_bunny_gem_is_available
96
+ require "bunny" unless defined?(Bunny)
97
+ end
98
98
  end
99
99
  end
@@ -13,7 +13,7 @@ module LogjamAgent
13
13
  @env = env
14
14
  @forwarder = Forwarders.get(app, env)
15
15
  @lines = []
16
- @uuid = UUID4R::uuid(1).gsub('-','')
16
+ @uuid = LogjamAgent.generate_uuid
17
17
  @fields = initial_fields.merge(:request_id => @uuid, :host => LogjamAgent.hostname, :process_id => Process.pid, :lines => @lines)
18
18
  @mutex = Mutex.new
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.8.2"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -22,6 +22,5 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "i18n"
23
23
 
24
24
  s.add_runtime_dependency "activesupport"
25
- s.add_runtime_dependency "uuid4r"
26
- s.add_runtime_dependency "time_bandits", [">= 0.4"]
25
+ s.add_runtime_dependency "time_bandits", [">= 0.6.0"]
27
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logjam_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-01 00:00:00.000000000 Z
11
+ date: 2013-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -16,70 +16,56 @@ dependencies:
16
16
  - - ! '>='
17
17
  - !ruby/object:Gem::Version
18
18
  version: '0'
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ! '>='
22
- - !ruby/object:Gem::Version
23
- version: '0'
24
19
  type: :development
25
20
  prerelease: false
26
21
  name: rake
27
- - !ruby/object:Gem::Dependency
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
33
22
  version_requirements: !ruby/object:Gem::Requirement
34
23
  requirements:
35
24
  - - ! '>='
36
25
  - !ruby/object:Gem::Version
37
26
  version: '0'
38
- type: :development
39
- prerelease: false
40
- name: i18n
41
27
  - !ruby/object:Gem::Dependency
42
28
  requirement: !ruby/object:Gem::Requirement
43
29
  requirements:
44
30
  - - ! '>='
45
31
  - !ruby/object:Gem::Version
46
32
  version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ name: i18n
47
36
  version_requirements: !ruby/object:Gem::Requirement
48
37
  requirements:
49
38
  - - ! '>='
50
39
  - !ruby/object:Gem::Version
51
40
  version: '0'
52
- type: :runtime
53
- prerelease: false
54
- name: activesupport
55
41
  - !ruby/object:Gem::Dependency
56
42
  requirement: !ruby/object:Gem::Requirement
57
43
  requirements:
58
44
  - - ! '>='
59
45
  - !ruby/object:Gem::Version
60
46
  version: '0'
47
+ type: :runtime
48
+ prerelease: false
49
+ name: activesupport
61
50
  version_requirements: !ruby/object:Gem::Requirement
62
51
  requirements:
63
52
  - - ! '>='
64
53
  - !ruby/object:Gem::Version
65
54
  version: '0'
66
- type: :runtime
67
- prerelease: false
68
- name: uuid4r
69
55
  - !ruby/object:Gem::Dependency
70
56
  requirement: !ruby/object:Gem::Requirement
71
57
  requirements:
72
58
  - - ! '>='
73
59
  - !ruby/object:Gem::Version
74
- version: '0.4'
60
+ version: 0.6.0
61
+ type: :runtime
62
+ prerelease: false
63
+ name: time_bandits
75
64
  version_requirements: !ruby/object:Gem::Requirement
76
65
  requirements:
77
66
  - - ! '>='
78
67
  - !ruby/object:Gem::Version
79
- version: '0.4'
80
- type: :runtime
81
- prerelease: false
82
- name: time_bandits
68
+ version: 0.6.0
83
69
  description: Logjam logger and request information forwarding
84
70
  email:
85
71
  - stefan.kaes@xing.com