cloudwatchlogger 1.0.1 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 132c7aab13981c643838904bd543fd3dadf18e35a46df7aa3cfba528e5732a7a
4
- data.tar.gz: 7f64be893d988a05eb5bf4b607261a95f4ff623fe73d13f09e573950b1cf9e9c
3
+ metadata.gz: 92d1bca725f78cc799cd9286809047cf057b2d65ba1f4819d8e7704ca042f912
4
+ data.tar.gz: 49e1294daaa98bac943f4879a783162836eff76bffc90812aad6536aa1fb44ba
5
5
  SHA512:
6
- metadata.gz: 1a81c48830dec6cfdb4ab851121f3cce19e2859d9549ac853338575f6e15cdadc1c03d5fa3beda5e04e68f76afdcb5ff3f00efb9ef1a0f65e3a454ec9992b841
7
- data.tar.gz: cb7283ed4226ad1deda01e16a4c1578297f6f416f8dc827a76cf8edbaf8e79e389e3af9d32067cd5ed1593f0f0374b70f9e7826fd25863ed12a017bc402f0dff
6
+ metadata.gz: 6a3b754db960b079cc3e340875ba0902bd6be22d3d3c029177946de85ac9ace921ef7ff47c014d762c3605f97679476eb1ecb99d3d5297d33065c7c8bc351f1f
7
+ data.tar.gz: e9fc349e6b9935b1db92b21d32d4bdddfebb45d6546493e6a1b6fe9b81bccea1c088301a66222a170dd16575e2fd63d38cb7cc0204e3b71c979e212a038d7ba2
data/README.md CHANGED
@@ -29,12 +29,36 @@ log = CloudWatchLogger.new({
29
29
  }, 'YOUR_CLOUDWATCH_LOG_GROUP', 'YOUR_CLOUDWATCH_LOG_STREAM', region: 'YOUR_CLOUDWATCH_REGION' )
30
30
  ```
31
31
 
32
- Provding an empty hash instead of credentials will cause the AWS SDK to search the default credential provider chain for credentials, namely:
32
+ Providing an empty hash instead of credentials will cause the AWS SDK to search the default credential provider chain for credentials, namely:
33
33
 
34
34
  1. Environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
35
35
  1. Amazon ECS container credentials (task role)
36
36
  1. Instance profile credentials (IAM role)
37
37
 
38
+ Besides the AWS region, you can also specify some other configuration options for your logger, such as:
39
+
40
+ | Property | Description |
41
+ |-----------------|--------------------------------------------------------------------------------------|
42
+ | `region` | AWS region. |
43
+ | `format` | The output format of your messages. `:json` generates JSON logs for hashed messages. |
44
+ | `open_timeout` | The open timeout in seconds. Defaults to 120. |
45
+ | `read_timeout` | The read timeout in seconds. Defaults to 120. |
46
+
47
+ This way, you could have something like this:
48
+
49
+ ```ruby
50
+ log = CloudWatchLogger.new({
51
+ access_key_id: 'YOUR_ACCESS_KEY_ID',
52
+ secret_access_key: 'YOUR_SECRET_ACCESS_KEY'
53
+ }, 'YOUR_CLOUDWATCH_LOG_GROUP', 'YOUR_CLOUDWATCH_LOG_STREAM',
54
+ {
55
+ region: 'YOUR_CLOUDWATCH_REGION',
56
+ format: :json
57
+ })
58
+ ```
59
+
60
+
61
+
38
62
  ### With Rails
39
63
 
40
64
  config/environments/production.rb
@@ -91,6 +91,7 @@ module CloudWatchLogger
91
91
 
92
92
  def connect!(opts = {})
93
93
  args = { http_open_timeout: opts[:open_timeout], http_read_timeout: opts[:read_timeout] }
94
+ args[:logger] = @opts[:logger] if @opts[:logger]
94
95
  args[:region] = @opts[:region] if @opts[:region]
95
96
  args.merge!( @credentials.key?(:access_key_id) ? { access_key_id: @credentials[:access_key_id], secret_access_key: @credentials[:secret_access_key] } : {} )
96
97
 
@@ -1,3 +1,3 @@
1
1
  module CloudWatchLogger
2
- VERSION = '1.0.1'.freeze
2
+ VERSION = '1.0.2'.freeze
3
3
  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: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zane Shannon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
11
+ date: 2023-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uuid
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: 1.3.6
88
88
  requirements: []
89
- rubygems_version: 3.2.3
89
+ rubygems_version: 3.0.3.1
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: Amazon CloudWatch Logs compatiable logger for ruby.