Simple fluentd logger library
Project description
Description
Fluentd logging library used to support standardized testing.
Programmatic example (Object logging)
from fluent import sender
from fluentd_logger.logger import Logger
tag = "agent"
app_label = "api"
logger = sender.FluentSender(tag=tag, host="localhost", port=24224)
service = Logger(logger)
messages = [
{
"A": "A1",
"B": "B1"
},
{
"C": "C1",
"D": "D1"
}
]
for message in messages:
service.emit(app_label=app_label, msg=message)
Package call pypi (File logging)
python -m fluentd_logger --file results.json --tag agent --label api --fluentd localhost:24224
Set --fluentd, --tag, --label options
There are 3 ways to set the above options
- Add an 'environment.properties' file containing the values. E.g.
FLUENTD_IP_PORT=localhost:24224 TAG=Agent LABEL=api
- Set the options through env vars. E.g.
export FLUENTD_IP_PORT=localhost:24224, export TAG=Agent export LABEL=4.2.1
- Set the values using this CLI interactively
Supported formats
Dict - one single test result (example)
{
"testName": "exampleTest",
"Db": "Mysql57",
"OS": "Centos7",
"logLocation": "http://logdatabase.com/exampleTest",
"startedat": "Sun Nov 1 10:16:52 EET 2020",
"endedat": "Sun Nov 1 10:22:52 EET 2020"
}
List of Dict(s) - multiple test result (example)
[
{
"testName": "exampleTest1",
"Db": "Mysql57",
"OS": "Centos7",
"logLocation": "http://logdatabase.com/exampleTest1",
"startedat": "Sun Nov 1 10:16:52 EET 2020",
"endedat": "Sun Nov 1 10:22:52 EET 2020"
},
{
"testName": "exampleTest2",
"Db": "Mysql57",
"OS": "Centos7",
"logLocation": "http://logdatabase.com/exampleTest2",
"startedat": "Sun Nov 1 10:22:52 EET 2020",
"endedat": "Sun Nov 1 10:30:52 EET 2020"
}
]
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
fluentd_logger-1.0.0.tar.gz
(5.1 kB
view details)
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 fluentd_logger-1.0.0.tar.gz.
File metadata
- Download URL: fluentd_logger-1.0.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e2698fc8a8835296ba880237c856c9f1a5059194e2eed0a03d1df3cce486ce
|
|
| MD5 |
23b65230ea1a9cbc6e1796c5c58aba82
|
|
| BLAKE2b-256 |
bf15d3c861f6760852c35d611cfccf1f3be1fd632693ae33a4cf2a5913da6c0d
|
File details
Details for the file fluentd_logger-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fluentd_logger-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecf49642a17a66be220d480721ed8fddf6f14dd1aef1889c5e61207a60426c42
|
|
| MD5 |
634f3cbacaa0740dbc66765e478c8d24
|
|
| BLAKE2b-256 |
660a9cb0849baf4f6f86e8f1202733c05067e210d8acc597d10460bba66b27ca
|