lib/semlogr/enrichers/property.rb in semlogr-0.1.3 vs lib/semlogr/enrichers/property.rb in semlogr-0.2.0
- old
+ new
@@ -1,13 +1,17 @@
+require 'semlogr/component_registry'
+
module Semlogr
module Enrichers
class Property
def initialize(**properties)
@properties = properties
end
def enrich(log_event)
- log_event.add_property(@properties)
+ log_event.add_property_if_absent(@properties)
end
end
+
+ ComponentRegistry.register(:enricher, property: Property)
end
end