From 28fda56b68e0da132db8e1fee43e72a65ae75513 Mon Sep 17 00:00:00 2001 From: johnmanjiro13 <28798279+johnmanjiro13@users.noreply.github.com> Date: Tue, 6 Sep 2022 14:03:50 +0900 Subject: [PATCH] feat: Add logger level to config params --- README.md | 8 +++++--- lib/fluent/plugin/out_raven.rb | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f57caa..ef5343b 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ If `tag` is specified as bufferd chunk key, it send as tag for sentry. - `dsn` (required): DSN KEY shown at setting page - `environment` : set environment +- `logger_level` : set log level of the sentry logger. default value is `info` - `default_level`: set default log level for sentry. default value is `error` ### record keys @@ -32,9 +33,10 @@ If `tag` is specified as bufferd chunk key, it send as tag for sentry. ```aconf - @type raven - dsn https://12345678@sentry.io/123456 - environment development + @type raven + dsn https://12345678@sentry.io/123456 + logger_level warn + environment development @type file path fluentd/log/error.*.buffer diff --git a/lib/fluent/plugin/out_raven.rb b/lib/fluent/plugin/out_raven.rb index 4bba3cc..09ad90c 100644 --- a/lib/fluent/plugin/out_raven.rb +++ b/lib/fluent/plugin/out_raven.rb @@ -26,6 +26,7 @@ class RavenOutput < Output config_param :dsn, :string, default: nil config_param :environment, :string, default: nil + config_param :logger_level, :string, default: 'info' config_param :default_level, :string, default: 'error' def configure(conf) @@ -34,6 +35,7 @@ def configure(conf) raise Fluent::ConfigError, 'Need to Set DSN' if dsn.nil? Sentry.init do |config| + config.logger.level = logger_level config.dsn = dsn config.environment = environment end