mms-alice-python-logger
Log Module for MMS/Alice standarzised log purposes
This is a package for writing logs to GCP App Engine.
How to use:
- The following dependencies are required:
mms-python-logger>=0.0.1
- Import module:
from mms_alice_python_logger_pkg.alice_log_handler import Logger
- Initalize the logger:
Cloud Function Logging:
logger = Logger(trace_id, project_id, function_name, resource_type)
logger = Logger('lksjdfl98', 'v135-5683-alice-ksk-explore', 'cf-sample-implementation', 'cloud_function')
App Engine Logging:
logger = Logger(trace_id, project_id, module_id, version_id, resource_type)
logger = Logger('lksjdfl98', 'v135-5683-alice-ksk-explore', 'app-flex-sample-service', 'v0.0.1', 'gae_app')
The following resource_types are supported:
Cloud Function: 'cloud_function' App Engine: 'gae_app'
When resource type is unrecoginzable logs will be processed to 'Global'
- Use the logger:
logger.info('your message')
logger.warning('your message')
logger.error('your message')
logger.critical('your message')
logger.debug('your message')
The logs are visible in Stackdriver Logging via GAE Application -> Module_id -> Version_id
Important
This log tool only works in App Engine Standard/Flexible and Cloud Function environment.
For local testing do not initialize the logger as it would ran into errors because of the missing GCP context.
How we log
We initialize the logger only in the "app.py" file. From there every log entry will be written - Modules used within app.py need to return the exceptions to the caller so error etc. get logged at one central point within app.py.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mms_python_logger-0.0.2.tar.gz.
File metadata
- Download URL: mms_python_logger-0.0.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69eccddbb23df7605c3ac41d5c660c39efdd54aaf810256379847eed92095d35
|
|
| MD5 |
cf536ed1f107723cb3c5af859259cecb
|
|
| BLAKE2b-256 |
a0bf592f7a7d75535793a1977f5c60c29e9bca92fcd251cde11d82debff0e765
|
File details
Details for the file mms_python_logger-0.0.2-py3-none-any.whl.
File metadata
- Download URL: mms_python_logger-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0f50bfa07dcf21769f3280c109d3c4511a0df0f7fd254b8ef3679f0cf98cfa5
|
|
| MD5 |
f2df708089de317e727ce1fcc397a3b0
|
|
| BLAKE2b-256 |
1aa8ea3da0299faa886bf462cace8120a41d1b90895cbe1d33a26759068fd1b6
|