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.dev1.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.

san_log_sdk-0.1.dev1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file san_log_sdk-0.1.dev1.tar.gz.

File metadata

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

File hashes

Hashes for san_log_sdk-0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 ef126b33f3486d54abf4b7878445e3dfc2b5340aeb3432671b73f56c46b8854a
MD5 93f473e0040b9efb83b50ed0236cbe85
BLAKE2b-256 a6d9fbfb302779e834cadbc421f7cec235d3d45326e238427fde54517e239195

See more details on using hashes here.

File details

Details for the file san_log_sdk-0.1.dev1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for san_log_sdk-0.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e01db8258e3d33c0a281725d8b125a653792c7852d55f1c41b7408ef5b5cecc
MD5 c7ced57a08fe3d2504b6f91087d892c6
BLAKE2b-256 cb66b4706dfaed2864488ca22bdcb0fd2b50e4b7410334e0ba1ef2725f5e4cc6

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