Logging for Stockholm University
Easy to use logging for Stockholm University.
Usage
Syslog
For normal usage which logs to syslog:
from su.logging import logging
logger = logging.getLogger("myapp")
logger.warning("My WARNING message")
Console
For easier developing you can also switch to console logging:
from su.logging import console, logging
logger = logging.getLogger("myapp")
logger.warning("My WARNING 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 logging, structured
logger = logging.getLogger("myapp")
logger.warning("User logged in", extra={"user": "simlu"})
try:
raise Exception("User performed illegal activity")
except Exception as e:
logger.exception(e, extra={"user": "simlu"})
Container usage
In Containers, which usually adhere to the 12 factor apps manifesto, you usually log to STDOUT and let your container engine deal with them.
from su.logging import console, logging, structured
logger = logging.getLogger("myapp")
logger.warning("My WARNING message")
TODO
Metadata
Release files for su-logging 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| su-logging-1.0.0.tar.gz | 2.7 kB | Without provenance | Details for su-logging-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| su_logging-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for su_logging-1.0.0-py3-none-any.whl |
Total release size: 5.7 kB
Release files / su-logging-1.0.0.tar.gz
| Download URL | su-logging-1.0.0.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0675c0bf25a72caa07a585a504282f306592d3f8b090a60b3102d3e63064339d
|
|
BLAKE2b-256 checksum How to use checksums |
b85ba70fe3205588b31c0e429ecb76c3a1fe85e2da56c94c1dd1b4eec93f8411
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.9.1 Darwin/20.4.0
|
Release files / su_logging-1.0.0-py3-none-any.whl
| Download URL | su_logging-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36cf3052efbce781049d036e50062e6c986a5c638d0a264f5addcea057f7fe6c
|
|
BLAKE2b-256 checksum How to use checksums |
284a870ccbb3fc9f27880bf2604f1d3ba64833d878cf5df0f3c0d02812a23cc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.9.1 Darwin/20.4.0
|
Security for su-logging 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.