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

Uploaded Python 3

File details

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

File metadata

  • Download URL: san_log_sdk-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 ec30a8d995c2dfa5d6a019ec711b48cffb31aac49f687311d0470925f2d3650c
MD5 7e250fdfa6c7db790d70c6bafe6a0b81
BLAKE2b-256 18229b9a864760239eeec53fc83515651158052be68911ce964b9d91919b9ee5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: san_log_sdk-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53fd65e80aa41953b9c8a3849f201433220bc2046446931708a95eca9cceeefd
MD5 de34100932fc8a7b920ecc9e11af357d
BLAKE2b-256 c040ffe2ddde98c5ddb05c37ed5644952f1e33c1df2372a10309c2f0f8af0b3e

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