Skip to main content

Logging for Stockholm University

Project description

Logging for Stockholm University

Easy to use logging for Stockholm University.

Usage

from su.logging import logging

logger = logging.getLogger("myapp")
logger.info("My INFO message")

For easier developing you can also enable console logging:

from su.logging import console, logging

logger = logging.getLogger("myapp")
logger.info("My INFO message")

Structured logging

We use logstash_formatter's LogstashFormatterV1 and remove some unused/unnecesary fields.

Depend on su-logging[structured] in e.g. your requirements.txt and then:

from su.logging import structured, logging

logger = logging.getLogger("myapp")
logger.info("User logged in", extra={"user": "simlu"})

try:
    raise Exception("User performed illegal activity")
except Exception as e:
    logger.exception(e, extra={"user": "simlu"})

TODO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

su_logging-0.2.1-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page