Skip to main content

Lightsail Logger

Lightsail Logger is a simple Python application designed to aggregate and display logs from all containers within a Lightsail service in one unified view. This tool is ideal for developers and operators who need a straightforward way to monitor and analyze logs from various containers running under a single Lightsail service.

Features

  • Aggregate Logs: Collect logs from multiple containers in one service.
  • Unified View: Display logs from all containers in a single overview.
  • Customizable: Adjust the logging window by specifying the time range.

Installation

You can install Lightsail Logger using pip. Open your terminal and run:

pip install lightsaillogger

Usage

simply import the class and call the logger method

from lightsaillogger.logger import LightsailLogger

# initiate a instance of lightsaillogger with the name of your service and the fetch interval
logger = LightsailLogger(service_name="name_of_your_container_service", fetch_interval_seconds=10)

logger.start_logging(minutes=10) # Looks back for logs in the last 10 minutes

Output:

Outputs the logs of your containers in order

2024-09-02T14:06 rq-worker  12:06:15 low: Job OK (91add817-598d-4916-bb72-1acac49871bb)
2024-09-02T14:06 rq-worker  Ending mock task
2024-09-02T14:06 rq-worker  12:06:15 Result is kept for 900 seconds
2024-09-02T14:11 nginx      172.26.37.209 - - [02/Sep/2024:12:11:03 +0000] "GET /fastapistatus HTTP/1.1" 200 15 "-" "ELB-HealthChecker/2.0" "-"
2024-09-02T14:11 fastapi    INFO:     172.26.37.209:0 - "GET /fastapistatus HTTP/1.0" 200 OK
2024-09-02T14:11 nginx      172.26.5.144 - - [02/Sep/2024:12:11:04 +0000] "GET /fastapistatus HTTP/1.1" 200 15 "-" "ELB-HealthChecker/2.0" "-"
2024-09-02T14:11 fastapi    INFO:     172.26.28.92:0 - "GET /fastapistatus HTTP/1.0" 200 OK
2024-09-02T14:11 fastapi    INFO:     172.26.5.144:0 - "GET /fastapistatus HTTP/1.0" 200 OK
2024-09-02T14:11 nginx      172.26.28.92 - - [02/Sep/2024:12:11:04 +0000] "GET /fastapistatus HTTP/1.1" 200 15 "-" "ELB-HealthChecker/2.0" "-"

Metadata

Release files for lightsaillogger 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lightsaillogger 0.1.6
File Size Uploaded
lightsaillogger-0.1.6.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lightsaillogger 0.1.6
File Interpreter ABI Platform
lightsaillogger-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / lightsaillogger-0.1.6.tar.gz

Download URL lightsaillogger-0.1.6.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fca2dee33a96e4613a3f70cb165d4768095f48aae2990c95732f91097ea1455b
BLAKE2b-256 checksum
How to use checksums
3d66cddee54698fe1ee7f5ce2364d55f9a80d134de3f0be1e602b4f954fe45de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / lightsaillogger-0.1.6-py3-none-any.whl

Download URL lightsaillogger-0.1.6-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d1dec12e7be2fe1b378e373fdbf3f4065f3777f41be61dac80427cdc59827bc
BLAKE2b-256 checksum
How to use checksums
664b87d7b65f60825aed96eaa750c3fb3a72c7d20957ffeb3330a5f162d9e709
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page