Skip to main content

A simple logging utility for sending logs to azure application insights using AzureLogHandler

Project description

Azure App Insights Logger

A simple logging utility for python application that provides consistent logging setup across different modules using AzureLogHandler. Log will also be streamted to the console.

Installation

pip install azappinsights-logger

Depdencies opencensus-ext-azure and python-dotenv should be installed with the package.

Usage

Create an environment variable with the name APPLICATIONINSIGHTS_CONNECTION_STRING and pass the value for app insights connections string.

from azappinsights_logger.logger import setup_logger

# Create a logger with default settings
logger = setup_logger("my.module")

# Create a logger with custom level
logger = setup_logger("my.module", level=logging.DEBUG)

# Use the logger
logger.info("This is an info message")
logger.debug("This is a debug message")
logger.error("This is an error message")

Features

  • Consistent logging format across all modules
  • Simple setup with sensible defaults
  • Customizable log levels and formats
  • Thread-safe logging configuration

License

This project is licensed under the MIT License

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

azappinsights_logger-0.0.7.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

azappinsights_logger-0.0.7-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file azappinsights_logger-0.0.7.tar.gz.

File metadata

  • Download URL: azappinsights_logger-0.0.7.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for azappinsights_logger-0.0.7.tar.gz
Algorithm Hash digest
SHA256 b01c457269396ddc305cebbcb38db71acd5a0c7e3187bcb47e1adc9e53ea6d48
MD5 3834047361c1f3d3a82b0c98a77e588e
BLAKE2b-256 3ba46af3740c9f2a5a67064b44ed85785dda921c9879444421056c93c1a505fe

See more details on using hashes here.

File details

Details for the file azappinsights_logger-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for azappinsights_logger-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1838f401ae2ecc343eb18637ad9b1830b78e41230b17015ba83c817101d502b8
MD5 3e8bfc68ccf8b5e47065cc5c49788485
BLAKE2b-256 98a5ddb62e60f2588ce62d76a0983e01976b4a24e588bb43034e2160564e6157

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