SRE Logging
Common logging setup package for SRE python programs.
If you have a Python program that's gonna be anywhere near production, or is in any way 'mission critical', it should use this package so that it can plug into our DataDog log analysis very easily.
Installation
pip install srelogging
Usage
In your program, as soon as the application starts, you'll want to call
srelogging.configure_logging():
import srelogging
# ...
srelogging.configure_logging()
Additionally, if you want to specify any custom logging
config (in Python logging dictConfig format)
then you can specify a file path in the arguments to configure_logging():
srelogging.configure_logging("logging_config.yml")
# contents of logging_config.yml
version: 1
formatters:
default:
class: srelogging.UTCFormatter
format: "%(asctime)s.%(msecs)03dZ [%(levelname)s] <%(module)s.py:%(lineno)d> %(message)s"
datefmt: "%Y-%m-%d %H:%M:%S"
handlers:
console:
class: logging.StreamHandler
level: DEBUG
formatter: default
stream: ext://sys.stdout
root:
level: WARNING
handlers: [console]
Metadata
Release files for srelogging 0.0.3
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 |
|---|---|---|---|---|
| srelogging-0.0.3.tar.gz | 2.9 kB | Without provenance | Details for srelogging-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| srelogging-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for srelogging-0.0.3-py3-none-any.whl |
Total release size: 5.8 kB
Release files / srelogging-0.0.3.tar.gz
| Download URL | srelogging-0.0.3.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
549fd364d993af7cada9287589df2be62ce76ba99139a50125a270c7f688e3e9
|
|
BLAKE2b-256 checksum How to use checksums |
018f77aa421b1b19490c130dea10cc99aad839e25f17c2df3ecf3540d62c2c8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Release files / srelogging-0.0.3-py3-none-any.whl
| Download URL | srelogging-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8332159e7b41eff6d3e2573f94d5df160aa95cc60d979cec0a3c7ba207c0d41
|
|
BLAKE2b-256 checksum How to use checksums |
ac8f772750e53e9848f66c7c4d8ad52b30464d852ff4a140b2f846b677f1201b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Security for srelogging 0.0.3
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.