async aliyun sls logger
Project description
aliyun-sls-logger
aliyun-sls-logger
is an implementation of asynchronous Aliyun logging designed to integrate with asynchronous code. This library provides no additional features beyond logging.
Installation
To install aliyun-sls-logger
, simply use pip:
pip install aliyun-sls-logger
Usage
To use aliyun-sls-logger
, create an instance of the QueuedLogHandler
class and add it to your logger. The QueuedLogHandler
requires the following parameters:
access_key_id
: The access key ID for your Aliyun account.access_key_secret
: The access key secret for your Aliyun account.endpoint
: The endpoint for your Aliyun SLS service.project
: The name of the project to log to.logstore
: The name of the logstore to log to.
Once you have created an instance of the QueuedLogHandler
, you can add it to your logger like any other handler:
from aiologger import Logger
from aiologger.levels import LogLevel
from aliyun_sls_logger.logger_handler import QueuedLogHandler
logger = Logger(name=__name__, level=LogLevel.INFO)
handler = QueuedLogHandler(
access_key_id='your_access_key_id',
access_key='your_access_key_secret',
end_point='your_endpoint',
project='your_project',
log_store='your_logstore',
extract_json=True,
extract_json_prefix='test_'
)
logger.add_handler(handler)
You can then use the logger as usual:
await logger.info('This is a log message.')
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
File details
Details for the file aliyun_sls_logger-0.3.0.tar.gz
.
File metadata
- Download URL: aliyun_sls_logger-0.3.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.9.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc909af256c77b58af6bf91f2aa5bd9c8d1cbf2d66f7cc10bf1520db1b606ee2 |
|
MD5 | 3c3dbf981a87ef51944b263db0aa8506 |
|
BLAKE2b-256 | 2af3c01e0ccb99335c0eff2d9f0d294c0d42ed6b26cdb431e62289acd015b260 |
File details
Details for the file aliyun_sls_logger-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: aliyun_sls_logger-0.3.0-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.9.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c57c7981beccd70814b38aeebcd3e9c9ad8212024438e57aa4c58ccd457f4ee8 |
|
MD5 | 5c7a4d3e26dbc8d5a81659fceed3548b |
|
BLAKE2b-256 | fedec465cb250804c6b71209d95c1f1a4626e0012077ca81f3297cb3bd1e9d6e |