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.6.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.6-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: azappinsights_logger-0.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 ecf1bc95ad53269c1a74a184c8f7f79dcd88971055044a21b3e7c8fc8d9abfbb
MD5 c7e1fc0e482aa94cd6d51414ae459ea5
BLAKE2b-256 12ce54c5567ebb61164824b4adc4e84ac5c2975da7ed933b799ec963f19288e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for azappinsights_logger-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4ac124103f3f0739ae5235e127c42f73daf18851369ebfc7f36737342723483c
MD5 b5ec4fa35b70651dbb40eee30b5c780d
BLAKE2b-256 2de67d15037da2254b935988d439e4c0557f49f27fa3fa590630983c2293a648

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