Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

docs: clarifies configuration options #128

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,76 @@ to tower and error capturing tactics is still valid and unchanged.
Necessary future changes caused by deprecations and/or changes in error handling behavior in the BEAM or Elixir can be just
made in `Tower` without need to change any of the service specific reporters.

## Configuration

### `reporters`

List of reporters Tower should report events to.

Default: `[Tower.EphemeralReporter]`

Example:

```elixir
config :tower, reporters: [TowerEmail]
```

### `log_level`

`Logger` messages this level and above will be reported.

Possible values are any of defined `Logger` levels (https://hexdocs.pm/logger/Logger.html#module-levels) or
`:none` to disable reporting of `Logger` messages.

Default: `:critical`

Example:

```elixir
config :tower, log_level: :error
```

### `ignored_exceptions`

List of exceptions that Tower should ignore and not report.

Default: `[]`

Example:

```elixir
config :tower, ignored_exceptions: [DBConnection.ConnectionError]
```

### `logger_metadata`

List of keys that Tower should pick up from the current process `Logger.metadata` when reporting events.

Default: `[]`

Example:

A common use case is setting `Logger.metadata(user_id: user.id)` at the start of your plugs or controller actions and
configure Tower:

```elixir
config :tower, logger_metadata: [:user_id]
```

so that it's included in the reported exception or message event as extra metadata.

Also if using Phoenix you can

```elixir
config :tower, logger_metadata: [:request_id]
```

so that you can co-relate your exceptions reports to the request id in your application logs.

More about Logger metadata:
- https://hexdocs.pm/logger/Logger.html#module-metadata
- https://hexdocs.pm/logger/Logger.html#metadata/1

## License

Copyright 2024 Mimiquate
Expand Down
Loading