Configuration

Configuration for Invenio-Logging.

Sentry can, in addition to the configuration variables listed, be further configured with the folllowing configuration variables (see Raven for further details):

  • SENTRY_AUTO_LOG_STACKS
  • SENTRY_EXCLUDE_PATHS
  • SENTRY_INCLUDE_PATHS
  • SENTRY_MAX_LENGTH_LIST
  • SENTRY_MAX_LENGTH_STRING
  • SENTRY_NAME
  • SENTRY_PROCESSORS
  • SENTRY_RELEASE
  • SENTRY_SITE_NAME
  • SENTRY_TAGS
  • SENTRY_TRANSPORT

Note

Celery does not deal well with the threaded Sentry transport, so you should make sure that your Celery workers are configured with:

SENTRY_TRANSPORT = 'raven.transport.http.HTTPTransport'
invenio_logging.config.LOGGING_CONSOLE = True

Enable logging to the console.

invenio_logging.config.LOGGING_CONSOLE_LEVEL = None

Console logging level.

Set to a valid Python logging level: CRITICAL, ERROR, WARNING, INFO, DEBUG, or NOTSET.

invenio_logging.config.LOGGING_CONSOLE_PYWARNINGS = None

Enable logging of Python warnings to the console.

By default, warnings are logged to the console if the application is in debug mode, otherwise warnings are not logged.

invenio_logging.config.LOGGING_FS_BACKUPCOUNT = 5

Number of rotated log files to keep.

invenio_logging.config.LOGGING_FS_LEVEL = None

Filesystem logging level.

Set to a valid Python logging level: CRITICAL, ERROR, WARNING, INFO, DEBUG, or NOTSET.

invenio_logging.config.LOGGING_FS_LOGFILE = None

Enable logging to the filesystem.

invenio_logging.config.LOGGING_FS_MAXBYTES = 104857600

Maximum size of logging file. Default: 100MB.

invenio_logging.config.LOGGING_FS_PYWARNINGS = False

Enable logging of Python warnings to filesystem logging.

invenio_logging.config.LOGGING_SENTRY_CELERY = False

Configure Celery to send logging to Sentry.

invenio_logging.config.LOGGING_SENTRY_CLASS = None

Import path of sentry Flask extension class.

This allows you to customize the Sentry extension class. In particular if you are logging to Sentry v6, you can set this to invenio_logging.sentry6.Sentry6.

invenio_logging.config.LOGGING_SENTRY_LEVEL = 'WARNING'

Sentry logging level.

Defaults to only reporting errors and warnings.

invenio_logging.config.LOGGING_SENTRY_PYWARNINGS = False

Enable logging of Python warnings to Sentry.

invenio_logging.config.SENTRY_DSN = None

Set SENTRY_DSN environment variable.

invenio_logging.config.SENTRY_PROCESSORS = ('raven.processors.SanitizePasswordsProcessor', 'invenio_logging.sentry.RequestIdProcessor')

Default Sentry event processors.

invenio_logging.config.SENTRY_TRANSPORT = 'raven.transport.threaded.ThreadedHTTPTransport'

Default Sentry transport.