chili_logger 0.0.3 → 0.0.5
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 +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +12 -1
- data/chili_logger-0.0.3.gem +0 -0
- data/chili_logger.gemspec +3 -3
- data/lib/chili_logger/version.rb +1 -1
- data/lib/errors/logging_error_handler/logging_error_handler.rb +8 -0
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0baddcb177c1e5a6676aa3a60040e37b17397958348944ff4f0b980b4c37bef2
|
4
|
+
data.tar.gz: 8511fd8734a086ec0b8fd82dea6329aa8e4bd351f6daa0405fa519d29b401c2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90f1f25ebd08ea66819dd74b86d05a073de1d317b7df3428e4bcda6ecfd5f94f7db5d907acbeed7a2ba5b7555a50e07e9a2d12d1a1217ab0571a4b03f8012318
|
7
|
+
data.tar.gz: 9319b3f0ffb1daf8800615873068bd96a4502424452009ca4a3683c776a3a4cd7231ff162c7bb68ec563898202436062d0cea0da3c4a9361db432a3b260e9527
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -33,7 +33,7 @@ ChiliLogger.instance.config({
|
|
33
33
|
log_env: 'development',
|
34
34
|
log_layer: 'creatives',
|
35
35
|
server_url: ENV['SERVER_URL'],
|
36
|
-
cloud_provider:
|
36
|
+
cloud_provider: ENV['CLOUD_PROVIDER'],
|
37
37
|
msg_broker_name: :rabbitmq,
|
38
38
|
msg_broker_config: {
|
39
39
|
user: ENV['RABBIT_USER'],
|
@@ -42,11 +42,22 @@ ChiliLogger.instance.config({
|
|
42
42
|
port: ENV['RABBIT_PORT'],
|
43
43
|
exchange_name: ENV['RABBIT_EXCHANGE'],
|
44
44
|
routing_key: ENV['RABBIT_ROUTING_KEY']
|
45
|
+
},
|
46
|
+
error_handler: :aws_sqs,
|
47
|
+
error_handler_config: {
|
48
|
+
region: ENV['CHILI_LOGGER_SQS_HANDLER_REGION'],
|
49
|
+
access_key_id: ENV['CHILI_LOGGER_SQS_HANDLER_KEY_ID'],
|
50
|
+
secret_access_key: ENV['CHILI_LOGGER_SQS_HANDLER_SECRET_KEY'],
|
51
|
+
queue_name: ENV['CHILI_LOGGER_SQS_HANDLER_QUEUE_NAME']
|
45
52
|
}
|
46
53
|
})
|
47
54
|
```
|
48
55
|
|
56
|
+
When configuring ChiliLogger, you MUST set msg_broker_name and msg_broker_config. All logs are published to this message broker and, without it, ChiliLogger can't work. For the time being, only :rabbitmq is supported.
|
49
57
|
|
58
|
+
You ALSO MUST set error_handler and error_handler_config. The error handler is the fallback option if the message broker is not available and, without it, ChiliLogger will break the application every time the message broker is down. For the time being, only :aws_sqs is supported.
|
59
|
+
|
60
|
+
Please note that if ChiliLogger tries to publish a log and both the Message Broker and the Error Handler are simultaneously down, the log will be discarded. This behavior makes sure logging problems never cause the app to break.
|
50
61
|
|
51
62
|
|
52
63
|
|
Binary file
|
data/chili_logger.gemspec
CHANGED
@@ -11,9 +11,9 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.homepage = 'https://gitlab.com/chiligumdev/chili_logger'
|
12
12
|
spec.license = 'MIT'
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
14
|
-
spec.add_dependency 'aws-sdk'
|
15
|
-
spec.add_dependency 'bunny'
|
16
|
-
spec.add_dependency 'httparty'
|
14
|
+
spec.add_dependency 'aws-sdk'
|
15
|
+
spec.add_dependency 'bunny'
|
16
|
+
spec.add_dependency 'httparty'
|
17
17
|
|
18
18
|
# Specify which files should be added to the gem when it is released.
|
19
19
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/chili_logger/version.rb
CHANGED
@@ -17,6 +17,14 @@ class ChiliLogger
|
|
17
17
|
|
18
18
|
def handle_error(error, log = nil)
|
19
19
|
@error_handler.handle_error(error, log)
|
20
|
+
rescue StandardError => e
|
21
|
+
puts '
|
22
|
+
There was a problem with both the Message Broker and the Logging Error Handler simultaneously.
|
23
|
+
To keep the application running and prevent downtime,
|
24
|
+
ChiliLogger will ignore this errors and discard the log it was currently trying to publish.
|
25
|
+
Please note that logs are being permanatly lost.
|
26
|
+
'
|
27
|
+
puts e
|
20
28
|
end
|
21
29
|
|
22
30
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chili_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lucas sandeville
|
@@ -14,44 +14,44 @@ dependencies:
|
|
14
14
|
name: aws-sdk
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bunny
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: httparty
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '0'
|
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: 0
|
54
|
+
version: '0'
|
55
55
|
description: placeholder
|
56
56
|
email:
|
57
57
|
- lucas.sandeville@gmail.com
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- bin/console
|
73
73
|
- bin/setup
|
74
74
|
- chili_logger-0.0.1.gem
|
75
|
+
- chili_logger-0.0.3.gem
|
75
76
|
- chili_logger.gemspec
|
76
77
|
- lib/brokers/rabbit_broker.rb
|
77
78
|
- lib/chili_logger.rb
|