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 Distribution
su-logging-0.3.0.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for su_logging-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b80197220344f87ec37f9bbfd505f8707c8a46b8433a3a844d58bae7c60250ba |
|
MD5 | 22d1ffbb8f8069e448abac8986b3256a |
|
BLAKE2b-256 | f8b5aa721f61872cf4099064eca8432e83a825a55306d04210c4a5e43a42248b |