Skip to main content

A global logging and service utilities package for Python projects, designed for seamless integration with Django applications. Developed by Lighthouse Info System Pvt Ltd., this package provides robust logging, configuration, and service management tools to enhance reliability and maintainability in Django-based projects.

Project description

global_service

A Python package for global logging, step-wise logging, and Oracle DB activity logging, with robust log delivery and local fallback.

Features

  • Centralized logging to a global service (HTTP endpoint)
  • Step-wise logger for tracking process steps
  • Oracle DB logging for web activity
  • Local fallback for failed log delivery
  • Fully dynamic configuration via code or environment variables

Installation

pip install global-service

Usage

from global_service import config, build_global_log_payload, send_log_to_global_service, StepLogger, save_step_logs_to_oracle

# Configure dynamically (recommended)
config.configure(
    GLOBAL_LOG_URL="http://your-log-server:8000/web_logs",
    APP_CODE="MY-APP-CODE",
    ORACLE_DB_HOST="dbhost",
    ORACLE_DB_PORT=1521,
    ORACLE_DB_SERVICE="ORCLPDB",
    ORACLE_USER="user",
    ORACLE_PASS="pass"
)

# Example: Send a log
payload = build_global_log_payload(request)
send_log_to_global_service(payload)

# Example: Step logger
step_logger = StepLogger()
step_logger.log("Step 1: Started")
step_logger.log("Step 2: Processing")
# ...
save_step_logs_to_oracle(payload, step_logger, request_body, response_body)

License

MIT License

Copyright (c) 2024 [Your Name or Organization]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

lhs_global_service_django-0.0.6.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

lhs_global_service_django-0.0.6-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for lhs_global_service_django-0.0.6.tar.gz
Algorithm Hash digest
SHA256 2e6c23442bbf5475872c0952c529eb1e2b96a8f802c61af27adb5104460b5c27
MD5 ea0bcf1c583fc26cda43c46863e8d0ab
BLAKE2b-256 10cbcb592021fff6ef0f88d33490876a6415d38f079a9cf8e07639f15aee3137

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lhs_global_service_django-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0d1877709cfc90e8db41982f446b47f249af0b23e71fe5b50cf3d7512ed817e2
MD5 5099788bdef9682de4a8d89a92c0abca
BLAKE2b-256 dbde690d9a4c004a6b51de1d8ed8e4f6e2e82a957b9a038e44c4d635a9f1a37d

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