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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b01c457269396ddc305cebbcb38db71acd5a0c7e3187bcb47e1adc9e53ea6d48
|
|
| MD5 |
3834047361c1f3d3a82b0c98a77e588e
|
|
| BLAKE2b-256 |
3ba46af3740c9f2a5a67064b44ed85785dda921c9879444421056c93c1a505fe
|
File details
Details for the file azappinsights_logger-0.0.7-py3-none-any.whl.
File metadata
- Download URL: azappinsights_logger-0.0.7-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1838f401ae2ecc343eb18637ad9b1830b78e41230b17015ba83c817101d502b8
|
|
| MD5 |
3e8bfc68ccf8b5e47065cc5c49788485
|
|
| BLAKE2b-256 |
98a5ddb62e60f2588ce62d76a0983e01976b4a24e588bb43034e2160564e6157
|