coralogix_logger 0.0.17 → 0.0.18

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +67 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56f317208d45c73dd8f4bd07c14583e68b54f835
4
- data.tar.gz: 19ea7e0e67bed6ea2df97481d962d2897ed9218f
3
+ metadata.gz: 0630141b65274b98d5fc8b04ca7a774ce1d22b37
4
+ data.tar.gz: 9dc607097852a9209f3079b6a1aa3d9f1cd082e5
5
5
  SHA512:
6
- metadata.gz: db23d7041b0f80ba6e92731425263b8a2a0f051a8d33a5103ccafd56dec750b9a155f448e6e258c1aa8b903f49d21d6fe7a4b38685c97687ace55024818bd971
7
- data.tar.gz: b106721209fc8b905c40d6c075fe9e1d3b39818132f416f940103b935e916042e0f7418427bf507cc8f143ce540e6877fd2f09d2555c83e83b80d14ace647e2f
6
+ metadata.gz: 59dd5a7f0ea95d4fdfdda6615efead99aa342f82b5af601766f9baf6f3ea3e269936ff3e8090ec427e49cd451876733f070fa82487b3a8d33c80bc0ae6eb626c
7
+ data.tar.gz: 605033c4472ef4d8b18a71adf8be785bd73592b7499d8373d92fa6aded67ea42b1c80125e3c9b793cfb86ca56cdc56197e47b4c67524f1702b48adc55e37d77e
data/README.md CHANGED
@@ -2,11 +2,22 @@
2
2
  # Croalogix SDK - Ruby Implementation
3
3
  This is an implementation of Coralogix Ruby SDK.
4
4
 
5
- ## INSTALL
5
+ ## Talbe of contents
6
+
7
+ 1. Install
8
+ 2. General
9
+ 3. Ruby
10
+ 4. Ruby on Rails
11
+ 5. Ruby on Rails + Puma
12
+ 6. Ruby on Rails + Unicorn
13
+
14
+
15
+ ## Install
16
+
6
17
  gem install coralogix_logger
7
18
 
8
19
 
9
- ## GENERAL
20
+ ## General
10
21
 
11
22
  **Private Key** - A unique ID which represents your company, this Id will be sent to your mail once you register to Coralogix.
12
23
 
@@ -16,7 +27,7 @@ gem install coralogix_logger
16
27
 
17
28
 
18
29
 
19
- ## USAGE
30
+ ## Ruby
20
31
 
21
32
  You must provide the following four variables when creating a Coralogix logger instance.
22
33
 
@@ -26,12 +37,12 @@ You must provide the following four variables when creating a Coralogix logger i
26
37
 
27
38
  **SubSystem Name** - Your application probably has multiple subsystems, for example: Backend servers, Middleware, Frontend servers etc. in order to help you examine the data you need, inserting the subsystem parameter is vital.
28
39
 
29
- ##### Example: Coralogix SDK ####
40
+ ##### Example: Ruby usage ####
30
41
  require 'coralogix_logger'
31
42
 
32
43
  PRIVATE_KEY = "11111111-1111-1111-1111-111111111111"
33
- APP_NAME = "MyTestApp"
34
- SUB_SYSTEM = "BL"
44
+ APP_NAME = "Ruby Tester"
45
+ SUB_SYSTEM = "Ruby tester client"
35
46
 
36
47
  # Configure Coralogix SDK. You need to define it only once per process.
37
48
  Coralogix::CoralogixLogger.configure(PRIVATE_KEY, APP_NAME, SUB_SYSTEM)
@@ -62,3 +73,53 @@ You must provide the following four variables when creating a Coralogix logger i
62
73
  logger.critical("Hello World!", category: "my category", className: "my class", methodName: "my method", threadId="thread id")
63
74
 
64
75
 
76
+ ## Ruby on Rails
77
+
78
+ 1. Currently the coralogix SDK supports Rails version >= 4
79
+ 2. Create coralogix.rb file under: config/initializers/ folder.
80
+ 3. Copy the following content into the file. Replace the constants with your values:
81
+
82
+ ##### Example: Rails configuration ####
83
+ require 'coralogix_logger'
84
+
85
+ PRIVATE_KEY = "11111111-1111-1111-1111-111111111111"
86
+ APP_NAME = "Ruby Rails tester"
87
+ SUB_SYSTEM = "Ruby Rails tester client"
88
+
89
+ Coralogix::CoralogixLogger.configure(PRIVATE_KEY, APP_NAME, SUB_SYSTEM)
90
+ coralogix_logger = Coralogix::CoralogixLogger.get_logger(SUB_SYSTEM)
91
+ Rails.logger.extend(ActiveSupport::Logger.broadcast(coralogix_logger))
92
+
93
+ 4. Now you can use your Rails logger as usual:
94
+
95
+ ##### Example: Rails usage ####
96
+ Rails.logger.info "Hello World from Rails!"
97
+
98
+
99
+ ## Ruby on Rails + Puma
100
+
101
+ 1. Configure Rails logger as explained above in the documentation.
102
+ 2. Copy the following content in the puma config file: config/puma.rb
103
+
104
+ ##### Example: Puma configuration ####
105
+
106
+ require 'coralogix_logger'
107
+
108
+ on_worker_boot do
109
+ Coralogix::CoralogixLogger.reconnect
110
+ end
111
+
112
+
113
+
114
+ ## Ruby on Rails + Unicorn
115
+
116
+ 1. Configure Rails logger as explained above in the documentation.
117
+ 2. Copy the following content in the unicorn config file: config/unicorn.rb
118
+
119
+ ##### Example: Unicorn configuration ####
120
+
121
+ require 'coralogix_logger'
122
+
123
+ after_fork do |server, worker|
124
+ Coralogix::CoralogixLogger.reconnect
125
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coralogix_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Royee Goldberg