Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(logging): Add section about logging to self-hosted #1200

Merged
merged 2 commits into from
Sep 7, 2019
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
51 changes: 46 additions & 5 deletions src/collections/_documentation/server/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Many settings available in `config.yml` will also be able to be configured in th

The environment name for this installation. This will also control defaults for things like `DEBUG`.

```python
```bash
SENTRY_ENVIRONMENT=production sentry ...
```

Expand All @@ -37,7 +37,7 @@ Many settings available in `config.yml` will also be able to be configured in th

The technical contact address for this installation. This will be reported to upstream to the Sentry team (as part of the Beacon), and will be the point of contact for critical updates and security notifications.

```python
```yaml
system.admin-email: 'admin@example.com'
```

Expand All @@ -47,7 +47,7 @@ Many settings available in `config.yml` will also be able to be configured in th

The URL prefix in which Sentry is accessible. This will be used both for referencing URLs in the UI, as well as in outbound notifications.

```python
```yaml
system.url-prefix: 'https://sentry.example.com'
```

Expand All @@ -57,14 +57,55 @@ Many settings available in `config.yml` will also be able to be configured in th

A secret key used for session signing. If this becomes compromised it’s important to regenerate it as otherwise its much easier to hijack user sessions.

```python
```yaml
system.secret-key: 'a-really-long-secret-value'
```

To generate a new value, we’ve provided a helper:

> $ sentry config generate-secret-key

## Logging

Sentry logs to two major places — `stdout`, and its internal project. To disable logging to the internal project, add a logger whose only handler is `'console'` and disable propagating upwards.

{% include components/alert.html
content="Explained below are the CLI flag and environment variable. They override the root logger and anything in `LOGGING.overridable`. Be very careful with this in a production system, because the Celery logger can be extremely verbose when set to INFO or DEBUG."
level="warning"
%}

`-l/--loglevel`

: Declared on the command line.

Sentry can override logger levels by providing the CLI with the `-l/--loglevel` flag.
The value of this can be one of the [standard Python logging level strings](https://docs.python.org/2/library/logging.html#levels).

```shell
sentry --loglevel=WARNING
```

`SENTRY_LOG_LEVEL`

: Declared in system environment.

Sentry can override logger levels with the `SENTRY_LOG_LEVEL` environment variable.
The value of this can be one of the [standard Python logging level strings](https://docs.python.org/2/library/logging.html#levels).

```shell
SENTRY_LOG_LEVEL=WARNING sentry ...
```

`LOGGING`

: Declared in `sentry.conf.py`.

You can modify or override the full logging configuration with this setting. Be careful not to remove or override important defaults. You can check [the default configuration](https://git.io/fjjna) for reference.

```python
LOGGING['default_level'] = 'WARNING'
```

## Redis

`redis.clusters`
Expand All @@ -75,7 +116,7 @@ Many settings available in `config.yml` will also be able to be configured in th

For example,

```python
```yaml
redis.clusters:
default: # cluster name
hosts: # connection options, passed to `rb.Cluster`
Expand Down