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
Close
Hashes for su_logging-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db5abcd563c993d3a13f96e785f118347a18f19f587c70b50ec8a64bcba1523c |
|
MD5 | 507b1304ce996f55602e2596226293a5 |
|
BLAKE2b-256 | c339e063c2de5c44c0fbfea63745e61283a6067f6b3f88c1c1e625f41b01aa59 |