Skip to main content

This is a powerful library handling the formatting of application logs and metrics to the LogInsights platform.

Project description

LogInsights-Library

LogInsights-Library is a powerful library for handling the formatting of application logs and metrics to the LogInsights platform. It is designed to help you monitor, analyze, and debug your applications with ease, offering deep insights into performance, usage patterns, and system health.

Features

  • Flexible and high-performance.
  • Full support for Python.
  • Capture and manage logs from across your application, with support for structured and unstructured log formats.
  • Define and track custom metrics to measure application performance and user interactions.
  • Easily capture exceptions and errors, providing detailed context for debugging.

Important: The Logger Must Be Configured Before Use

Before using the logger in your application, it must be configured with the appropriate connection details. Ensure that the logger is set up with the correct connection string, client application ID, and secret before any logging or metric capturing takes place.

Code example

settings.py

from loginsights.main import LogInsightsLogger

# Configuration variables (replace with your own details)
connection_string = ""  # Replace with your connection string
client_application_id = -1  # Replace with the given client application id
secret = ""  # Replace with the given secret

config = {
    "ConnectionString": connection_string,
    "ClientApplicationId": client_application_id,
    "Secret": secret
}

# Configure the logger
LogInsightsLogger.configure(config)

app.py

from loginsights.main import LogInsightsLogger

logger = LogInsightsLogger.get_logger()

# Example of logging and metric capturing in the application
username = "testuser"  # Example username

# Log an informational message
logger.info(f"{username} has been authenticated, redirecting {username} to login")

# Add a custom metric
logger.add_metric("New Users", {"Username": username})

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loginsights-0.0.8.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loginsights-0.0.8-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file loginsights-0.0.8.tar.gz.

File metadata

  • Download URL: loginsights-0.0.8.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for loginsights-0.0.8.tar.gz
Algorithm Hash digest
SHA256 bf5a4022277fbd9f16cdd7fd497610ce4295f609487b76166f170fca5568b297
MD5 564c637f111e95887843a9a59793eac9
BLAKE2b-256 d20f83d3a5451d8f56a1e2acb7bafd009ab2b535b7e892ecd0beb28c02b39db5

See more details on using hashes here.

File details

Details for the file loginsights-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: loginsights-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for loginsights-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c111df0a9a6698272ee4fb9d53e2b9610aa2396b05a660ba248d4caf27b8d94e
MD5 256c51ccfbe062c4831e26218471e7f1
BLAKE2b-256 7b1e54a0d70113b272f4db4f523c57dc828239c0323828ff6ce93da551cdc9be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page