Skip to main content

Simple SDK to share logs and overal status

Project description

SJSDK

Little package for containarized process to share logs and overal status. This simple, really simple package is intended to be used as a private resource for all services to be able to centralice all log events to a main page.

How to use it:

In your logger:

import logging

from log_sdk.threaded_handler imprt SanLogSDK

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)


# host and port of san log page
base_url = "localhost"
project_uuid = "e9b136ee-ffcb-4cdd-bea0-cc560796a01c"
port = 8765
logger.addHandler(SanLogSDK(base_url, project_uuid, port))

If you need the endpoint for status in your containarized process, you need to pass a function that creates de response dict and pass it the server.run as:

from log_sdk import server

from my_module import my_status_func

host = "0.0.0.0"
port = "8001"

if __name__== "__main__":
    server.run(my_status_func, host=host, port=port)

And this is loaded in the command of your docker-compose file like so:

services:
  app:
    container_name: my_process_container
    build:
      context: .
      network: "host"
      
    network_mode: "host"
    working_dir: /app
    command: python /app/my_status_server.py 

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

san_log_sdk-0.1.0.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.

san_log_sdk-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file san_log_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: san_log_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.4 Linux/6.6.46-1-lts

File hashes

Hashes for san_log_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c401361a1cb944a47ba4eefc128c95d012a1b04d61ef3f74bff2590cc8c465b4
MD5 ab7dfa4f62a4cfb67b381f4dc67ffce0
BLAKE2b-256 4c4bc37c78472302b9186b5db3e979368fae758858b08f71b90f991d471d4253

See more details on using hashes here.

File details

Details for the file san_log_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: san_log_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.4 Linux/6.6.46-1-lts

File hashes

Hashes for san_log_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c21430e757561e9d0c11feb0eec2df9fb2ff50b2170e4f1ee27a8bdf68533ab
MD5 fb8d1144dcf16f79c8b5c4a1b747843c
BLAKE2b-256 f79b6be7f17806d9421be5857c661b9d9ae1d12a4a2bc879a3c585d09cb149c0

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