Module: Logasm::Utils
- Defined in:
- lib/logasm/utils.rb
Constant Summary collapse
- HOST =
::Socket.gethostname
- DECIMAL_FRACTION_OF_SECOND =
3
Class Method Summary collapse
-
.application_name(service_name) ⇒ String
Return application name.
-
.build_event(metadata, level, service_name) ⇒ Hash
Build logstash json compatible event.
Class Method Details
.application_name(service_name) ⇒ String
Return application name
Returns lower snake case application name. This allows the application value to be used in the elasticsearch index name.
32 33 34 |
# File 'lib/logasm/utils.rb', line 32 def self.application_name(service_name) Inflecto.underscore(service_name) end |
.build_event(metadata, level, service_name) ⇒ Hash
Build logstash json compatible event
15 16 17 18 19 20 21 22 |
# File 'lib/logasm/utils.rb', line 15 def self.build_event(, level, service_name) overwritable_params .merge() .merge( application: application_name(service_name), level: level.to_s.downcase ) end |