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')
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
google_structlog-1.0.2.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for google_structlog-1.0.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeb5a22cafdb63e9503fbc4dd0dcc2abdd56ef205c8fe2bcb342da376af6c26b |
|
MD5 | 6b14cfd452f96e32445ecd22c72ca565 |
|
BLAKE2b-256 | fba98b4353d95159e0e2e90bae205c81dbb2a416382373a19fc038ff2e5f3d3a |