lib/semantic_logger/appender/rabbitmq.rb in semantic_logger-4.15.0 vs lib/semantic_logger/appender/rabbitmq.rb in semantic_logger-4.16.0
- old
+ new
@@ -58,10 +58,14 @@
#
# application: [String]
# Name of this application to appear in log messages.
# Default: SemanticLogger.application
#
+ # metrics: [Boolean]
+ # Also send metrics only events to rabbitmq.
+ # Default: true
+ #
# RabbitMQ Parameters:
#
# rabbitmq_host: [String]
# Host for AMQP connection. in Bunny this is called :host but here it has
# been remapped to avoid conflicting with SemanticLogger's :host param.
@@ -74,16 +78,18 @@
# password: [String]
# Password for AMQP connection
# Default: nil
#
# more parameters supported by Bunny: http://rubybunny.info/articles/connecting.html
- def initialize(queue_name: "semantic_logger", rabbitmq_host: nil, metrics: false, **args, &block)
+ def initialize(queue_name: "semantic_logger", rabbitmq_host: nil,
+ level: nil, formatter: nil, filter: nil, application: nil, environment: nil, host: nil, metrics: true,
+ **args, &block)
@queue_name = queue_name
@rabbitmq_args = args.dup
@rabbitmq_args[:host] = rabbitmq_host
@rabbitmq_args[:logger] = logger
- super(level: level, formatter: formatter, filter: filter, application: application, host: host, metrics: metrics, &block)
+ super(level: level, formatter: formatter, filter: filter, application: application, environment: environment, host: host, metrics: metrics, &block)
reopen
end
def reopen
@connection = Bunny.new(@rabbitmq_args)