Skip to content

Commit

Permalink
Update the README
Browse files Browse the repository at this point in the history
  • Loading branch information
jebentier committed Oct 28, 2020
1 parent 674a68f commit ded3a9b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ contextual_logger.register_context do
# This makes it so that the logger will not raise a MissingDefinitionError
# when code tries to apply a context key that does not map to a definition
# in the registry
raise_on_definition_missing false
raise_on_missing_definition false
string :service_name
Expand All @@ -194,35 +194,35 @@ end
### Production Best Practices
In `production` environments it is best to protect your logging from excess bloat by
setting `strict` to `true`, and `raise_on_definition_missing` to `false` in order
setting `strict` to `true`, and `raise_on_missing_definition` to `false` in order
to protect against logging causing unnecessary errors.
```ruby
contextual_logger.register_context do
strict true
raise_on_definition_missing false
raise_on_missing_definition false
end
```
### Test and Development Best Practices
When running in `test` and `development` environments it is best to be quickly aware
that context is being erroniously added to the logs by setting both `strict` and
`raise_on_definition_missing` to `true`.
`raise_on_missing_definition` to `true`.
```ruby
contextual_logger.register_context do
strict true
raise_on_definition_missing true
raise_on_missing_definition true
end
```
### Available Configurations
| Config | Description | Default |
| ------ | :---------: | ------: |
| `strict` | | `true` |
| `raise_on_definition_missing` | | `true` |
| `strict` | When enabled the logger will enforce the shape of the context specified by dropping context keys that are not definied and running formatters across the data | `true` |
| `raise_on_missing_definition` | When enabled, the logger will raise and exception if a context key is added to the logger that does not have a definition defined | `true` |
### Available Definitions
Expand Down

0 comments on commit ded3a9b

Please sign in to comment.