Skip to main content

LogHarvestor Logo

Log Harvestor - LinkedIn   LogHarvestor - Twitter   Log Harvestor - You Tube

log-harvestor-py

Documentation

See API Docs for Log-Harvestor API Documetnation.

This package is specific to Python.

Please see our docs for other supported languages, or use standard HTTP requests.

Installation


pip install log-harvestor-py

Usage


This package requires that you have a Log Harvestor account, and Forwarder's created. If you have not done this yet:

  1. Go to LogHarvestor.com
  2. Register for a new Account (This is free) Register
  3. Create a new Forwarder - Link
  4. Generate a Forwarder Token

Now you can use this forwarder token to send logs, by adding it to the config:

  from logharvestor import Forwarder

  pvt_token  = 'your_forwarder_token'
  fwdr = Forwarder(token=token, verbose=True)
  fwdr.log('test', {"title": 'Hello World'})

Configuration


Option Default Description
Token "" The JWT token assigned to your forwarder
ApiUrl https://app.logharvestor.com/log This should never change unless using proxies
Verbose false Verbose mode prints info to the console

Examples

  • Configuring

  from logharvestor import Forwarder

  pvt_token := "your_forwarder_token"
  fwdr = Forwarder(token=token, verbose=True)
  • Test Connection

  from logharvestor import Forwarder

  pvt_token := "your_forwarder_token"
  fwdr = Forwarder(token=token, verbose=True)
  
  success, res = fwdr.test_conn()
  # `success` != True, the connection failed
  # `res` contains the error that occured

  # Error Examle (Invalid Token):
  #   False, <Response [401]> 
  
  • Logging

  from logharvestor import Forwarder

  pvt_token := "your_forwarder_token"
  fwdr = Forwarder(token=token, verbose=True)

  # Strings
  fwdr.log('test', msg="Hello World!")

  # Numbers
  fwdr.log('test', msg=123)

  # Objects / Dicts
  fwdr.log('test', msg={"a": 123, "b": "456", "c": "hello"})

  # Arrays / Lists
  fwdr.log('test', msg=["hello", "mars", "goodbye", "world"]))
  fwdr.log('test', msg=[1, 2, 34, 567, 8, 90])

  # Mixed
  fwdr.log('test', msg={"a": 123, "b": {"c": "123", "d": {}}})

  # Nested
  fwdr.log('test', msg=[123, "abc", [1, 2, 3], {"question": "Hello?", "answer": "World!"}, {"question": "So long?", "answer": "Thanks for all the fish!"}])

Recomendations


  1. Keep your Logging specific, and consise. This makes searching faster and more accurate
  2. No need to add timestamps or info about the forwarder. This information is automatically included with the log.

LogHarvestor Logo

Metadata

Release files for log-harvestor-py 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for log-harvestor-py 1.0.0
File Size Uploaded Provenance Actions
log-harvestor-py-1.0.0.tar.gz 3.6 kB Without provenance Details for log-harvestor-py-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for log-harvestor-py 1.0.0
File Interpreter ABI Platform Actions
log_harvestor_py-1.0.0-py3-none-any.whl Python 3 none any Details for log_harvestor_py-1.0.0-py3-none-any.whl

Total release size: 7.2 kB

Release files / log-harvestor-py-1.0.0.tar.gz

Download URL log-harvestor-py-1.0.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1a2367dff85897936a9dd77224305cf5a3ba78e02e8eb44fcf383ae98506aeba
BLAKE2b-256 checksum
How to use checksums
e0998569a995d2268ad392b94b4790276d16479773b5d3eba3c42b1093805ec6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

Release files / log_harvestor_py-1.0.0-py3-none-any.whl

Download URL log_harvestor_py-1.0.0-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a0dc6624a5446b8b3b4a4ea936bac0ace5f384480ddf20671b2137ef76fbfcd
BLAKE2b-256 checksum
How to use checksums
24d35e78c6ef70be5b8721fa07ba7ac0167934607a8edb4815ab2d1a7a1a877e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

Security for log-harvestor-py 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page