Skip to content

Commit

Permalink
Merge pull request #4 from johnmanjiro13/add-log-level-param
Browse files Browse the repository at this point in the history
feat: Add logger level to config params
  • Loading branch information
mocyuto authored Sep 6, 2022
2 parents bc90726 + 28fda56 commit 92d8b44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,9 +33,10 @@ If `tag` is specified as bufferd chunk key, it send as tag for sentry.

```aconf
<match **>
@type raven
dsn https://[email protected]/123456
environment development
@type raven
dsn https://[email protected]/123456
logger_level warn
environment development
<buffer tag>
@type file
path fluentd/log/error.*.buffer
Expand Down
2 changes: 2 additions & 0 deletions lib/fluent/plugin/out_raven.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 92d8b44

Please sign in to comment.