cloudwatchlogger 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a17994bb84e5d5609af00c3070dd2bced4ee62e6
4
- data.tar.gz: 8efdb64ae010cdf433cc989e5148db191626d9fa
3
+ metadata.gz: e6ca7c28dbaa9d4cd65eb71b0fbfae51d8e1933a
4
+ data.tar.gz: 434c182d0862b63b6ab7d0c8ac6a020def97ceb5
5
5
  SHA512:
6
- metadata.gz: 082cb521281d5086725d7fa8f9a013916651c0d765a70879ca2cc8c8aaaf2289ec916cc9421ff3c554d839b4c6e2d069f9397093ae588cf2cbef395efabb108a
7
- data.tar.gz: 48c14c6ee5a121d5456904c5b9c9530597de71c63b17091c5501d1c212634947b818c81d1f376d16fdd5cc077bfd1ebee027bce34ccc05abf854907262bea738
6
+ metadata.gz: cc7ed35ff37a17bd5a73effbd298ec14f7585a37a215254591efb7b982b3bf6bcd0b5fcab2760c0a315c58147f1e29667973e6b21ff5cf72f9c6826dfe90f9df
7
+ data.tar.gz: b4fdd61589e900f84a528c7ae58de745e9642e48891cb5c73545fd8638507c9fd313dd551c9018d4d8839782727163b72c02a3573210631bd424c4f5a0abd106
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 amvse
3
+ Copyright (c) 2018 Zane Shannon
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -20,6 +20,15 @@ log = CloudWatchLogger.new({access_key_id: 'YOUR_ACCESS_KEY_ID', secret_access_k
20
20
  log.info("Hello World from Ruby")
21
21
  ```
22
22
 
23
+ In case you need to pass different region or group's different Log Stream name:
24
+
25
+ ```ruby
26
+ log = CloudWatchLogger.new({
27
+ access_key_id: 'YOUR_ACCESS_KEY_ID',
28
+ secret_access_key: 'YOUR_SECRET_ACCESS_KEY'
29
+ }, 'YOUR_CLOUDWATCH_LOG_GROUP', 'YOUR_CLOUDWATCH_LOG_STREAM', region: 'YOUR_CLOUDWATCH_REGION' )
30
+ ```
31
+
23
32
  ### With Rails
24
33
 
25
34
  config/environments/production.rb
@@ -70,10 +79,10 @@ Will produce the following log message in CloudWatch Logs:
70
79
  ```
71
80
  "<Date> severity=WARN, boom=box, bar=soap"
72
81
  ```
73
-
82
+
74
83
  Bugs
75
84
  -----
76
85
 
77
- https://github.com/amvse/cloudwatchlogger/issues
86
+ https://github.com/zshannon/cloudwatchlogger/issues
78
87
 
79
- Pull requests welcome.
88
+ Pull requests welcome.
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
  s.license = "http://opensource.org/licenses/MIT"
12
12
 
13
13
  s.authors = ["Zane Shannon"]
14
- s.email = 'zcs@amvse.com'
15
- s.homepage = 'http://github.com/amvse/cloudwatchlogger'
14
+ s.email = 'z@zcs.me'
15
+ s.homepage = 'http://github.com/zshannon/cloudwatchlogger'
16
16
 
17
17
  s.files = %w{ README.md Gemfile LICENSE cloudwatchlogger.gemspec } + Dir["lib/**/*.rb"]
18
18
  s.require_paths = ['lib']
@@ -23,5 +23,5 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.add_runtime_dependency 'uuid', '~> 2'
25
25
  s.add_runtime_dependency 'multi_json', '~> 1'
26
- s.add_runtime_dependency 'aws-sdk', '~> 2'
27
- end
26
+ s.add_runtime_dependency 'aws-sdk-cloudwatchlogs', '~> 1'
27
+ end
@@ -1,4 +1,4 @@
1
- require 'aws-sdk'
1
+ require 'aws-sdk-cloudwatchlogs'
2
2
  require 'thread'
3
3
 
4
4
  module CloudWatchLogger
@@ -44,14 +44,14 @@ module CloudWatchLogger
44
44
 
45
45
  super do
46
46
  loop do
47
-
47
+
48
48
  if @client.nil?
49
49
  connect! opts
50
50
  end
51
-
51
+
52
52
  msg = @queue.pop
53
53
  break if msg == :__delivery_thread_exit_signal__
54
-
54
+
55
55
  begin
56
56
  event = {
57
57
  log_group_name: @log_group_name,
@@ -61,7 +61,7 @@ module CloudWatchLogger
61
61
  message: msg
62
62
  }]
63
63
  }
64
-
64
+
65
65
  if token = @sequence_token
66
66
  event[:sequence_token] = token
67
67
  end
@@ -93,7 +93,7 @@ module CloudWatchLogger
93
93
  def deliver(message)
94
94
  @queue.push(message)
95
95
  end
96
-
96
+
97
97
  def connect!(opts={})
98
98
  @client = Aws::CloudWatchLogs::Client.new(
99
99
  region: @opts[:region] || 'us-east-1',
@@ -119,4 +119,4 @@ module CloudWatchLogger
119
119
 
120
120
  end
121
121
  end
122
- end
122
+ end
@@ -1,5 +1,5 @@
1
1
  module CloudWatchLogger
2
2
 
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
 
5
- end
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudwatchlogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zane Shannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-15 00:00:00.000000000 Z
11
+ date: 2018-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uuid
@@ -39,21 +39,21 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: aws-sdk
42
+ name: aws-sdk-cloudwatchlogs
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2'
47
+ version: '1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2'
54
+ version: '1'
55
55
  description: Logger => CloudWatchLogs
56
- email: zcs@amvse.com
56
+ email: z@zcs.me
57
57
  executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
@@ -67,7 +67,7 @@ files:
67
67
  - lib/cloudwatchlogger/client/aws_sdk.rb
68
68
  - lib/cloudwatchlogger/client/aws_sdk/threaded.rb
69
69
  - lib/cloudwatchlogger/version.rb
70
- homepage: http://github.com/amvse/cloudwatchlogger
70
+ homepage: http://github.com/zshannon/cloudwatchlogger
71
71
  licenses:
72
72
  - http://opensource.org/licenses/MIT
73
73
  metadata: {}
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: 1.3.6
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.5.1
90
+ rubygems_version: 2.6.11
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: AWS CloudWatchLogs compatiable logger for ruby.