Simple python pip package to log to elasticsearch. The main focus of this package is simplicity, such that errorlogging becomes super easy and needs only to be set up once.
Install
Hosted on PyPi now: https://pypi.org/project/simpleelasticlogging/
So just simply run `pip install simpleelasticlogging´
Bleeding Edge version:
`pip install git+https://github.com/JustinGuese/pip-simple-elasticsearch-logging´
Usage
from simpleelasticlogging import ElasticLogger
el = Elasticlogger()
def boundToFail():
array = [2, 6, "tendies"]
for elem in array:
try:
elem = elem / 2
except Exception as e:
msg = {
"error" : repr(e),
"elementWhereItHappened": elem,
"otherNotes": "boundToFail Function"
}
el.log(msg)
# raise
boundToFail()
Elasticsearch connection
The connection supports host, port, user and password for elastic.
The default values are - which can be changed:
- host="localhost"
- port=9200
- es_user = None
- es_pass = None
- appname = "app"
- errorindexname = "errors"
es_user and es_pass only need to be passed if xpack security in Elasticsearch is enabled, together with the Elasticsearch user.
Description
The good thing with a NoSql database is, that you can basically submit anything you want to the log() function as it takes everything.
I created this even though other packages exist to make it even simpler to log to elastic, and to support username and password with Elasticsearch.
Metadata
Release files for simpleelasticlogging 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simpleelasticlogging-0.1.1.tar.gz | 2.9 kB | Without provenance | Details for simpleelasticlogging-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simpleelasticlogging-0.1.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for simpleelasticlogging-0.1.1-py2.py3-none-any.whl |
Total release size: 6.9 kB
Release files / simpleelasticlogging-0.1.1.tar.gz
| Download URL | simpleelasticlogging-0.1.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5402e5699766151f6dc8b4540aff98de8be2095174f72f9c7af05bd45478daa0
|
|
BLAKE2b-256 checksum How to use checksums |
c413cd6cf86b18551948667a150a9bbc9ba278669ab8eb6986e26d49afa18644
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
|
Release files / simpleelasticlogging-0.1.1-py2.py3-none-any.whl
| Download URL | simpleelasticlogging-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
097e5e937425d16dc558b01732acc981d349d46ec1a656d45e2821e8220af045
|
|
BLAKE2b-256 checksum How to use checksums |
61d7e1e068f7445b763091c4f2b4fa678d109b746ffa6c554be32bc385a83753
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
|
Security for simpleelasticlogging 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.