RTALogger 0.1.2 → 1.1.1

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
  SHA256:
3
- metadata.gz: 9d28795fc1ab81da8fe17aea8489d11559cd05d06caa7545a30ac5abcda1e5eb
4
- data.tar.gz: 5bd61d89f1d4ec087294845f742c4799c3899590adae9366ab013f67a30924cf
3
+ metadata.gz: b037c1dbb6f51228afd43cfc7e576e86a7e46e711b96cedaaeb9a5b3e5f3f1ec
4
+ data.tar.gz: d1e2fb9ee4cddf0b221b0ec9c471117953387c502337e3d438b82348ce4111ae
5
5
  SHA512:
6
- metadata.gz: a0264ccb95941af08eb9ea0be0019a03e7151e7f5eb8a570fec66c421ebc8f031df7e3ac712aec515c603c66996d1c6976d95d1e4a1326be20c4946fb9ebcb22
7
- data.tar.gz: 62ad72d8e5443de241cff8c9c8fc30c34006dd8fbae052f5388a275ecfea104b42a6225f5eb358df774a1811c7c64a4b0527b86120a6e9e505f8be0e09a2523c
6
+ metadata.gz: 1fe26e02fcdb17eb44f56644469f7061a925f5dfdc25afcde968b1d910eb5f25a13a49e25afeec8898e78eb7398bbcabe53fca3b7ca98dc85afdeae304ba12a0
7
+ data.tar.gz: 11fdcff4f789f1eb739cd307c9f60c52b7f6a2816caa60699b0d1f607fba0a3cf7619e58dd17d6817b4711ba35f4998585e64a8d0f099142f8c3009210220759
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- RTALogger (0.1.2)
4
+ RTALogger (1.1.1)
5
5
  fluent-logger (~> 0.9)
6
6
  jbuilder (~> 2.10)
7
7
 
data/README.md CHANGED
@@ -6,23 +6,25 @@ Also provide multiple extendable log repositories including wrapping existing lo
6
6
  All log manager's main features are configable through a json config file.
7
7
 
8
8
  Main purposes of developing this gem are:
9
- - Creating easy to use logger interface.
10
- - Apply some rules and restrictions about log structure and data format, which prevents chaos in application log information.
11
- - No interrupt or wait time for log consumer modules.
9
+ - Creating standard logging API to seperate application from existing variety of loggers.
10
+ - Wrapping around existing loggers to get advantage of different loggers at the same time.
11
+ - Make it possible to easily replace a logger component with new one without any changes in the consumer application.(for example Rails standard Logger with Fluentd)
12
+ - Creating easy to use logger interface for developers.
13
+ - Apply some rules and restrictions about log structure and data format, which prevents chaos in application's log information.
14
+ - No interrupt, wait time or overhead for log consumer modules.
12
15
  - Utilize multiple log repositories at the same time in background (Console, File, UDP, FluentD, etc.)
13
- - Make it possible to implement customized log repositories.
16
+ - Make it possible to implement customize log repositories.
14
17
 
15
18
  Main Features:
16
19
  - Creating multiple log manager instances with different configuration is possible entire application.
17
20
  - Each log manager instance could be configured via a json file.
18
21
  - Each log manager instance could be config to use multiple log repositories such as Console, File, UDP, Fluentd.
19
22
  - Runtime configurations could be applied through log manager APIs.
20
- - By using multi threading techniques and also buffering techniques,
21
- all logging process will handled in seperated thread.
23
+ - By using multi threading and buffering techniques, all logging process will handled in seperated thread.
22
24
  So the log consumer modules should not be wait for log manager to finish the logging task.
23
25
  - Multiple standard log severity levels are available through topic APIs (debug, info, warning, error, fatal, unknown)
24
26
  - Main features could be set and manipulate through json configuration file.
25
- - And at the end, it is easy to use for ruby backend developers.
27
+ - And at the end, it is easy to use for ruby developers.
26
28
 
27
29
  ## Installation
28
30
 
@@ -32,11 +34,11 @@ Add this line to your application's Gemfile:
32
34
  gem 'RTALogger'
33
35
  ```
34
36
 
35
- And then execute:
37
+ Then execute:
36
38
 
37
39
  $ bundle install
38
40
 
39
- Or install it yourself as:
41
+ Or install it yourself via following command:
40
42
 
41
43
  $ gem install RTALogger
42
44
 
@@ -47,12 +49,12 @@ To add gem to your rails application:
47
49
  ## Usage
48
50
  #### RTA Log Data Structure
49
51
  To use log manager APIs, first step is to have a quick review on Log Data Structure
50
- - Application: The root of each log data record is Application, which specify the log data owner application.
52
+ - Application: The root of each log data record is the Application name, which specify the log data owner application.
51
53
  - Topic: By adding multiple topics to log manager you can categorize log data in logical topics.
52
54
  - Context: Under each topic, one or multiple contexts (in one level) could be defined.
53
- - As an instance the Application could by 'MyEShopApp', one of Topics could be 'Authentication' and
54
- Contexts could be 'uer_name' which attend in application authorization process.
55
- - The next step is log severity level, which determines that the log record severity (debug, information, warning, error, fatal, unknown)
55
+ - As an instance for Application 'MyEShopApp', one of Topics could be 'Authentication' and
56
+ Context could be 'uer_name' which attend in application authorization process.
57
+ - The next step is log severity level, which determines the log record severity (debug, information, warning, error, fatal, unknown)
56
58
  - At last the final element is log message, which contains log message data.
57
59
 
58
60
  ### Which Log Severity Levels to use
@@ -77,6 +79,51 @@ To use log manager APIs, first step is to have a quick review on Log Data Struct
77
79
  # the parameter is the json config file
78
80
  log_manager.config_use_json_file('rta_logger_config.json')
79
81
  ```
82
+ - Sample configuration json file
83
+ ```
84
+ {
85
+ "rta_logger":
86
+ {
87
+ "default_manager": "develop",
88
+ "log_managers":
89
+ [
90
+ {
91
+ "manager_name": "develop",
92
+ "enable": true,
93
+ "app_name": "TestApp",
94
+ "severity_level": "debug",
95
+ "buffer_size": 100,
96
+ "flush_wait_seconds": 15,
97
+ "repositories":
98
+ [
99
+ {
100
+ "enable": true,
101
+ "type": "console",
102
+ "formatter": "delimited_text",
103
+ "delimiter": "|"
104
+ },
105
+ {
106
+ "enable": true,
107
+ "type": "File",
108
+ "file_path": "./log/log.txt",
109
+ "roll_period": "daily",
110
+ "roll_size": "1048576",
111
+ "formatter": "delimited_text",
112
+ "delimiter": "|"
113
+ },
114
+ {
115
+ "enable": true,
116
+ "type": "fluentd",
117
+ "host": "localhost",
118
+ "port": "8888",
119
+ "formatter": "json"
120
+ }
121
+ ]
122
+ }
123
+ ]
124
+ }
125
+ }
126
+ ```
80
127
  - Add new topic to log manager and get the topic instance
81
128
  ```ruby
82
129
  # the parameter is the topic name
@@ -98,60 +145,68 @@ To use log manager APIs, first step is to have a quick review on Log Data Struct
98
145
  ```
99
146
  the result will be:
100
147
  ```
101
- {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":0,"message":"user_id is nil for user: Tom"}
102
- {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":1,"message":"User Tom is trying to login"}
103
- {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":2,"message":"Authentication failed for user Tom"}
104
- {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":3,"message":"Error connecting to data base for user Tom"}
105
- {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":4,"message":"Authentication service has been stopped working"}
106
- {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":5,"message":"An unknown error occured during authentication. user name: Tom"}
148
+ {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":"DEBUG","message":"user_id is nil for user: Tom"}
149
+ {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":"INFO","message":"User Tom is trying to login"}
150
+ {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":"WARN","message":"Authentication failed for user Tom"}
151
+ {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":"ERROR","message":"Error connecting to data base for user Tom"}
152
+ {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":"FATAL","message":"Authentication service has been stopped working"}
153
+ {"occurred_at":"2020-11-04 15:56:58:785","app_name":"TestApp","topic_title":"Authentication","context_id":"Tom","severity":"UNKNOWN","message":"An unknown error occured during authentication. user name: Tom"}
107
154
  ```
108
155
  - json config file sample
109
156
  ```json
110
157
  {
111
- "RTALogger":
158
+ "rta_logger":
112
159
  {
113
- "Default_Manager": "Develop",
114
- "Log_Managers":
160
+ "default_manager": "develop",
161
+ "log_managers":
115
162
  [
116
163
  {
117
- "Manager_Name": "Develop",
118
- "Enable": true,
119
- "App_Name": "TestApp",
120
- "Log_Severity": 2,
121
- "Buffer_Size": 100,
122
- "Flush_Wait_Seconds": 15,
123
- "Formatter" : "JSON",
124
- "Repos":
164
+ "manager_name": "develop",
165
+ "enable": true,
166
+ "app_name": "TestApp",
167
+ "severity_level": "debug",
168
+ "buffer_size": 100,
169
+ "flush_wait_seconds": 15,
170
+ "repositories":
125
171
  [
126
172
  {
127
- "Enable": true,
128
- "Type": "Console"
129
- },
130
- {
131
- "Enable": true,
132
- "Type": "UDP",
133
- "Host": "localhost",
134
- "Port": 8888
173
+ "enable": true,
174
+ "type": "console",
175
+ "formatter":
176
+ {
177
+ "type": "text",
178
+ "delimiter": "|"
179
+ }
135
180
  },
136
181
  {
137
- "Enable": false,
138
- "Type": "File",
139
- "File_Path": "../../log/log.txt",
140
- "Roll_Period": "daily",
141
- "Roll_Size": "1048576"
182
+ "enable": false,
183
+ "type": "file",
184
+ "file_path": "log.txt",
185
+ "roll_period": "daily",
186
+ "roll_size": "1048576",
187
+ "formatter":
188
+ {
189
+ "type": "text",
190
+ "delimiter": "|"
191
+ }
142
192
  },
143
193
  {
144
- "Enable": true,
145
- "Type": "Fluentd",
146
- "Host": "localhost",
147
- "Port": "24442",
148
- "TLS_Options":
194
+ "enable": false,
195
+ "type": "fluentd",
196
+ "host": "localhost",
197
+ "port": "8888",
198
+ "formatter":
149
199
  {
150
- "ca":",/path/to/cacert.pem",
151
- "cert":"/path/to/client-cert.pem",
152
- "key":"/path/to/client-key.pem",
153
- "key_passphrase":"test"
154
- }
200
+ "type": "json"
201
+ }
202
+ }
203
+ ],
204
+ "topics":
205
+ [
206
+ {
207
+ "title": "test",
208
+ "enable": true,
209
+ "severity_level": "info"
155
210
  }
156
211
  ]
157
212
  }
@@ -166,47 +221,64 @@ the result will be:
166
221
  log_manager.config_use_json_file('rta_logger_config.json')
167
222
 
168
223
  The file structure:
169
- - RTALogger : the root element of RTALogger json configuration.
170
- - Default_Manager: the name of default log manager config, when there is
224
+ - rta_logger : the root element of rta_logger json configuration.
225
+ - default_manager: the name of default log manager config, when there is
171
226
  multiple log manager configuration in Log_Managers array.
172
- - Log_Managers : the array of LogManagers with different configuration.
227
+ - log_managers : the array of LogManagers with different configuration.
173
228
  It is possible to define multiple log manager configurations for differen usages.
174
- - Name: the name of log manager. It will be used to define the default log manager.
175
- - Enable: (true/false) The value of this property activate or deactivate entire log manager.
176
- - App_Name: Application name as the owner of log data.
177
- - Log_Severity: Defines which level of log data will be stored in log repositories.
178
- - BufferSize: The memory buffer size (number of buffered log objects) to
229
+ - manager_name: the name of log manager. It will be used to define the default log manager.
230
+ - enable: (true/false) The value of this property activate or deactivate entire log manager.
231
+ - app_name: Application name as the owner of log data.
232
+ - severity_level: Defines which level of log data will be stored in log repositories.
233
+ - buffer_size: Minimune possible value for this attribute is 100 and defines memory buffer size (number of buffered log objects) to
179
234
  decread api consumers wait time. when the buffer is full the flush operation will
180
235
  save buffered logs to log repositoies.
181
- - Flush_Wait_Seconds: Time in soconds which log managers wait to flush buffered log objects
236
+ - flush_wait_seconds: Minimum possible value for this attribure is 10 seconds and defines time in soconds which log managers wait to flush buffered log records
182
237
  to log repository.
183
- - Formatter: (JSON/TEXT) declare log format when it's required to converrt log object to text.
184
- - Repos: Array of log repositories. It is possible to define multiple log repositories to
238
+ - repositories: Array of log repositories. It is possible to define multiple log repositories to
185
239
  store log data. there are variaty of log repositories and it is possible to
186
240
  add new ones. Each item in Repos array will configure a log repository.
241
+ Pre-defined types are described below, also it's possible to implement your custome repo type
242
+ and register it to RTALogger.
187
243
  - Log repository types and config:
188
- 1- Console: Show log data in text format on standard out put
189
- - "Type":"Console"
190
- - "Enable": [true/false] this will activate or deactivate log repository.
191
- 2- File: Store log data in a file.
192
- - "Type":"Console"
193
- - "Enable": [true/false] this will activate or deactivate log repository.
194
- - "File_Path": [file path and file name] the path and the name to store log data.
195
- - "Roll_Period": ["daily"/"weekly"/"monthly"] the period to generate new log file.
196
- - "Roll_Size": [bytes] the maximum size of log file to
244
+ 1- console: Show log data in text format on standard out put
245
+ - "type": "console"
246
+ - "enable": [true/false] this will activate or deactivate log repository.
247
+ - "foramtter" is the text, json or any custome defined types as LogRecord formatter
248
+ - "type": ["text"/"json"] type of formatter
249
+ - "delimiter": [any text delimiter you need.(as an instance pipe line "|")]
250
+ if formatter not defined then the json formatter will be used
251
+ 2- file: Store log data in a file.
252
+ - "type": "console"
253
+ - "enable": [true/false] this will activate or deactivate log repository.
254
+ - "file_path": [file path and file name] the path and the name to store log data.
255
+ - "roll_period": ["daily"/"weekly"/"monthly"] the period to generate new log file.
256
+ - "roll_size": [bytes] the maximum size of log file to
197
257
  roll file and create the new log file
198
- 3- UDP: Send log data over UDP on network.
199
- - "Type":"Console"
200
- - "Enable": [true/false] this will activate or deactivate log repository.
201
- - "Host": IP of the server to send log data.
202
- - "Port": Port of server to send log data.
203
- 4- Fluentd: send log data to Fluentd Log collector over network using TCP/IP protocol.
204
- - "Type":"Console"
205
- - "Enable": [true/false] this will activate or deactivate log repository.
206
- - "Host": IP of the server to send log data.
207
- - "Port": Port of server to send log data.
208
- - "TLS_Options": TLS configuration to stablish a secure TCP connection to Fluentd Server.
209
-
258
+ - "foramtter" is the text, json or any custome defined types as LogRecord formatter
259
+ - "type": ["text"/"json"] type of formatter
260
+ - "delimiter": [any text delimiter you need.(as an instance pipe line "|")]
261
+ if formatter not defined then the json formatter will be used
262
+ 3- udp: Send log data over UDP on network.
263
+ - "type": "udp"
264
+ - "enable": [true/false] this will activate or deactivate log repository.
265
+ - "host": IP of the server to send log data.
266
+ - "port": Port of server to send log data.
267
+ 4- fluentd: send log data to Fluentd Log collector over network using TCP/IP protocol.
268
+ - "type": "fluentd"
269
+ - "enable": [true/false] this will activate or deactivate log repository.
270
+ - "host": IP of the server to send log data.
271
+ - "port": Port of server to send log data.
272
+ - "tls_options": TLS configuration to stablish a secure TCP connection to Fluentd Server.
273
+ - "foramtter" is the text, json or any custome defined types as LogRecord formatter
274
+ - "type": ["text"/"json"] type of formatter
275
+ - "delimiter": [any text delimiter you need.(as an instance pipe line "|")]
276
+ if formatter not defined then the json formatter will be used
277
+ - topics: This is an optional item. When you need to customize a specific topic severity level or
278
+ enable value, you can define the settings here.
279
+ - title: The topic title to customize. (mandatoy).
280
+ - severity_level: Defines which level of log data will be stored in log repositories.
281
+ - enable: [true/false] to enable or disable logging process of the topic.
210
282
  ```
211
283
  - Some useful features
212
284
  ```ruby
@@ -214,14 +286,38 @@ the result will be:
214
286
  log_manager.app_name = 'myTestApp'
215
287
 
216
288
  # update specific topic log level if necessary
217
- log_manager.update_topic_level(controller_name, RTALogger::LogSeverity::INFO)
289
+ log_manager.update_topic_severity_level(topic_title, RTALogger::SeverityLevel::INFO)
290
+
291
+ # update all topics severity level if necessary
292
+ log_manager.update_all_topics_severity_level(RTALogger::SeverityLevel::INFO)
218
293
 
219
- # update all topics log level if necessary
220
- log_manager.update_all_topics_log_level(RTALogger::LogSeverity::INFO)
294
+ # enable or disable specific topic if necessary
295
+ log_manager.update_topic_enable(topic_title, [true/false])
296
+
297
+ # enable or disable all topic if necessary
298
+ log_manager.update_all_topics_enable([true/false])
221
299
  ```
222
300
  - Implement and Expand
223
- It is possible to implement new log repositories.
224
- All repository classes should inherit from 'RTALogger::LogRepository'
301
+ It is possible to implement new log repositories. There will be fue rules to implement and
302
+ integrate new customized log repository with RTALogger LogManager.
303
+
304
+ 1- Define you class inside RTALogger module.
305
+
306
+ 2- The class should be inherited from 'RTALogger::LogRepository'.
307
+
308
+ 3- Also appropriate naming convention is necessary.
309
+ As an example if you are implementing a Console Repo, your class name should be LogRepositoryConsole and
310
+ your source code in a ruby file and name it log_repository_console.rb
311
+
312
+ 4- After implementing your own log repository, you should register the class at run-time using the following syntax:
313
+ ```ruby
314
+ RTALogger::LogFactory.register_log_repository :console, 'log_repository_console.rb'
315
+ ```
316
+ Another example: LogRepositoryMyCustomizedUdp
317
+
318
+ ```ruby
319
+ RTALogger::LogFactory.register_log_repository :my_customized_udp, 'log_repository_my_customized_udp.rb'
320
+ ```
225
321
  Here is 'LogRepositoryConsole' implementation:
226
322
  ```ruby
227
323
  require_relative 'log_repository'
@@ -1,3 +1,3 @@
1
1
  module RTALogger
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
@@ -1,20 +1,36 @@
1
- require_relative 'log_formatter_text'
2
- require_relative 'log_formatter_json'
1
+ require_relative 'log_formatter_base'
3
2
 
4
3
  module RTALogger
5
4
  # Log factory to get new instance of log formatter
6
5
  module LogFactory
7
6
  def self.log_formatter_default
8
- RTALogger::LogFormatterJSON.new
9
- # RTALogger::LogFormatterText.new
7
+ create_formatter(:json)
10
8
  end
11
9
 
12
- def self.log_formatter_json
13
- RTALogger::LogFormatterJSON.new
10
+ def self.create_formatter(type, config_json = '')
11
+ lib_file = @log_formatters[type.to_sym]
12
+ raise "unregistered formatter class: #{type.to_s}" if lib_file.nil? || lib_file.empty?
13
+ begin
14
+ load lib_file
15
+ rescue
16
+ raise "unable to load formatter class file: #{lib_file}"
17
+ end
18
+
19
+ formatter_class_name = 'RTALogger::' + ('log_formatter_' + type.to_s).split('_').map(&:capitalize).join
20
+ formatter_class = Object.const_get(formatter_class_name)
21
+ return nil unless formatter_class
22
+ result = formatter_class.new
23
+
24
+ return result if config_json.empty?
25
+ result.load_config(config_json) if result.present?
26
+ return result
14
27
  end
15
28
 
16
- def self.log_formatter_text
17
- RTALogger::LogFormatterText.new
29
+ def self.register_log_formatter(type, class_file_name)
30
+ @log_formatters[type.to_sym] = class_file_name
18
31
  end
32
+
33
+ @log_formatters = {:text => 'log_formatter_text.rb',
34
+ :json => 'log_formatter_json.rb'}
19
35
  end
20
36
  end
@@ -1,56 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'log_repository_console'
4
- require_relative 'log_repository_file'
5
- require_relative 'log_repository_udp'
6
- require_relative 'log_repository_fluent'
7
-
8
3
  module RTALogger
9
4
  # this module generates object instance
10
5
  module LogFactory
11
- def self.new_log_repository_console
12
- LogRepositoryConsole.new
13
- end
6
+ def self.create_repository(type, config_json = '')
7
+ lib_file = @log_repositories[type.to_sym]
8
+ raise "unregistered repository class: #{type.to_s}" if lib_file.nil? || lib_file.empty?
14
9
 
15
- def self.new_log_repository_file(file_path = 'log.txt', period = 'daily', shift_size = 1_048_576)
16
- LogRepositoryFile.new(file_path, period, shift_size)
17
- end
10
+ begin
11
+ load lib_file
12
+ rescue
13
+ raise "unable to load repository class file: #{lib_file}"
14
+ end
18
15
 
19
- def self.load_log_repository_file(config_json)
20
- file_path = config_json['File_Path'].to_s
21
- period = config_json['Roll_Period'].to_s
22
- shift_size = config_json['Roll_Size'].nil? ? 1_048_576 : config_json['Roll_Size'].to_i
23
- ::RTALogger::LogFactory.new_log_repository_file(file_path, period, shift_size)
24
- end
16
+ # repo_class_name = 'RTALogger::' + type.split('_').map(&:capitalize).join
17
+ repo_class_name = 'RTALogger::' + ('log_repository_' + type.to_s).split('_').map(&:capitalize).join
18
+ repo_class = Object.const_get(repo_class_name)
19
+ return nil unless repo_class
20
+ result = repo_class.new
25
21
 
26
- def self.new_log_repository_udp(host = '127.0.0.1', port = 4913)
27
- LogRepositoryUDP.new(host, port)
22
+ # result = LogRepository.create type.to_sym
23
+ return result if config_json.empty?
24
+ result.load_config(config_json) if result.present?
25
+ return result
28
26
  end
29
27
 
30
- def self.load_log_repository_udp(config_json)
31
- host = config_json['Host'].to_s
32
- port = config_json['Port'].nil? ? 4913 : config_json['Port'].to_i
33
- ::RTALogger::LogFactory.new_log_repository_udp(host, port)
28
+ def self.register_log_repository(type, class_file_name)
29
+ @log_repositories[type.to_sym] = class_file_name
34
30
  end
35
31
 
36
- def self.new_log_repository_fluent(host = 'localhost', port = '24224', tls_options = nil)
37
- LogRepositoryFluent.new(host, port, tls_options)
38
- end
39
-
40
- def self.load_log_repository_fluent(config_json)
41
- host = config_json['Host'].to_s
42
- port = config_json['Port'].to_s
43
- tls_options = config_json['TLS_Options']
44
- ::RTALogger::LogFactory.new_log_repository_fluent(host, port, tls_options)
45
- end
46
-
47
- def self.create_repository(type, config_json)
48
- result = nil
49
- result = new_log_repository_console if type.to_s.casecmp('Console').zero?
50
- result = load_log_repository_file(config_json) if type.to_s.casecmp('File').zero?
51
- result = load_log_repository_udp(config_json) if type.to_s.casecmp('UDP').zero?
52
- result = load_log_repository_fluent(config_json) if type.to_s.casecmp('Fluentd').zero?
53
- result
54
- end
32
+ @log_repositories = {:console => 'log_repository_console.rb',
33
+ :file => 'log_repository_file.rb',
34
+ :udp => 'log_repository_upd.rb',
35
+ :fluentd => 'log_repository_fluentd.rb'}
55
36
  end
56
37
  end