write log to cloud logging or fluentd, for app in gcp
Project description
GCP Log
Install and config
Cloud Logging
pip install google-cloud-logging
** Logs Writer 角色 **: https://cloud.google.com/logging/docs/setup/python
Auth 说明
参照 google.auth
的认证方式:
-
If the environment variable
GOOGLE_APPLICATION_CREDENTIALS
is set to the path of a valid service account JSON private key file, then it is loaded and returned. The project ID returned is the project ID defined in the service account file if available (some older files do not contain project ID information). -
If the
Google Cloud SDK
_ is installed and has application default credentials set they are loaded and returned.To enable application default credentials with the Cloud SDK run::
`gcloud auth application-default login`
If the Cloud SDK has an active project, the project ID is returned. The active project can be set using::
`gcloud config set project`
-
If the application is running in the
App Engine standard environment
_ then the credentials and project ID from theApp Identity Service
_ are used. -
If the application is running in
Compute Engine
_ or theApp Engine flexible environment
_ then the credentials and project ID are obtained from theMetadata Service
_. -
If no credentials are found, :class:
~google.auth.exceptions.DefaultCredentialsError
will be raised.
Project details
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
Hashes for gcp_mixed_logging-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41b77cb988e10504e910e6da9297529c25b4ba4978ea47a268e6b6045bf929f1 |
|
MD5 | 04eb50d4ce82513010bed64059904282 |
|
BLAKE2b-256 | 147eafa96fde1d5b9e5bc5febd535a6fd5e96d7d3281604996daed7a963f79b2 |