Send queryable JSON structured logs to Google Cloud (GCP) stackdriver from python apps
Project description
Out of the box setup for python apps to send structured logs to Google Cloud's Stackdriver, in a format that allows stackdriver queries over the structure.
This package sets up structured logging with stackdriver that Just Works(TM): no configuration required. There's no confurability, but virtually no API means its easy to leave behind if you outgrow it.
Usage
from google_structlog import getLogger
logger = getLogger()
logger.warn('Danger Will Robinson', source='Robot', target='Will Robinson', threat='Boredom')
The logger comes from structlog and allows all the options you'd expect on a structlog.get_logger()
logger, including binding of repeated attributes:
from google_structlog import getLogger
logger = getLogger()
# Include source= and target= values in the output of all calls to sublogger
sublogger = logger.bind(source='Robot', target='Will Robinson')
sublogger.warn('Danger Will Robinson: impending maintenance', threat='Responsibility')
Releasing a new version to pypi
- Bump version in
setup.py
, make sure we stay ahead of Chrome and Firefox rm -rf ./dist/*
if needed to remove past versionspython3 setup.py sdist bdist_wheel
twine upload dist/*
- Login to pypi as
snickell
lol
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for google_structlog-43.12.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bade03939e11983b662d5fcb320ea2e29831ef7984bd39b3bb281c6aafe6ec81 |
|
MD5 | 2d5234e2490540dddd8622a4d6a91481 |
|
BLAKE2b-256 | b8a607e7b96958d105d13e32e511e3eeacbe683c06e1fa87a76db90f40b382bd |