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.5.tar.gz (5.0 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.5-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: azappinsights_logger-0.0.5.tar.gz
  • Upload date:
  • Size: 5.0 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.5.tar.gz
Algorithm Hash digest
SHA256 ff54241f8d9fb7b25de5baa5f6b3fff285989bf793c92d99d7d6f34dd1e2b7e8
MD5 919c377634375fad8a78fe11e9c044b5
BLAKE2b-256 4066ff6c18333ee013b132ecad42b0a8610beacc39d84a8f999de884b723d5a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for azappinsights_logger-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 240fad6042debaa0b6595b7534f0ca98b78d798bf07d4902bbfb1ce794c1f8c9
MD5 6c84cc62f97c1a0e16c555993991b317
BLAKE2b-256 7672daf95449fadfa5c3698e0777138891dc22c18682e64e3ffe2246d2fb4497

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