Skip to main content

A client application for handling logging sending to a server

Project description

Lion Handler - Loghandler application - Client

Team

Authored by: Saulo Leão - @sleao

Coauthored by: Thiago Pinho - @thiagolrpinho

Lion Handler

Over engineering things is my passion and I will do it forever. That being said, this repo includes both a server for receiving and managing logs via websockets/API and a client that you can attach to your code that will send the logs over.

Setting up goals

To better track this project, I'll write a bunch of things I think it should have in order to achieve my goals for this tool.

My basic idea for this is to be able to send/receive logs and the server should store it in MongoDB, but also to have some sort of control panel, to explore the logs with analytics, maybe or something like that.

The server itself should have a frontend (the control panel), with access control (a.k.a. login/logout), and the hability to create application tokens.

Application tokens will be used as a sort of access control to the log server and to minimize the amount of data in each message. An application token should be a HS256 encrypted JWT, with info about the app on its payload.

I'm building this to work in a container based enviroment, that hosts many applications with one or more instances of each application, so there should be a way to differentiate the instances (maybe use hostnames, since each are unique to the application pod?)

On receiving a connection, the server should validate the token (or deny the connection) and assign the application instance to its application bucket

A bucket should be a collection of logs related to an application, each log with its instance tag.

  • Client

    • Can send INFO, WARNING, ERROR, CRITICAL and DEBUG
    • Can handle both String and JSON messages
    • Has a fallback in case the server is unreachable

Connection Manager

In order to better manage all the socket connections from all different applications, a Connection Manager class is defined. Besides handling both instance connection and disconnection, it should be able to return a list of active Apps/Instances, following the JSON specification below

{
    "cerco": {
        "running_instances": 3,
        "instances": {
            "a2b5": {
                "socket": "hash",
                "connected_at": "6/11/2021"
            },
            "a2b6": {
                "socket": "WebSocket",
                "connected_at": "6/11/2021"
            },
            "a2b7": {
                "socket": "WebSocket",
                "connected_at": "6/11/2021"
            }
        }
    },
    "midas": {
        ...
    }
}

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

lionhandler-0.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

lionhandler-0.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file lionhandler-0.3.tar.gz.

File metadata

  • Download URL: lionhandler-0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for lionhandler-0.3.tar.gz
Algorithm Hash digest
SHA256 55edcccf13219bc90a5e65889bd42e9128195cd96709c404fff8a17c5fc7a1fe
MD5 12cf9e85204167488851b7ea1a179b87
BLAKE2b-256 b38f96eff471d4d53e295d576f9d946d2e6fe9f02dbc392709ed357bdac9c8c3

See more details on using hashes here.

File details

Details for the file lionhandler-0.3-py3-none-any.whl.

File metadata

  • Download URL: lionhandler-0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for lionhandler-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b2f0e73730c352af1a74b2afc3a9499fd48e799debb94ca96b9f0ca9f75032ee
MD5 8808199a7f42c9196dbf3beda26fb3aa
BLAKE2b-256 aeaf33a4e8e185d69b63ea933859df417f520bd6a4d06eaf3887449f7749dfa0

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