Skip to main content

AWS CloudLogger

This project allows for sending log messages from remote devices to AWS, either to a SQS FIFO queue or Cloudwatch. Additionally a library is included for managing and ingesting those logs via the python REPL.

Deployment

Download and install Serverless, then deploy the LogCatcher lambda

cd lambda_functions/LogCatcher
sls deploy

This sets up a Cloudwatch Log Group, an SQS FIFO queue, and an https endpoint in API Gateway. Requests sent to the https endpoint will be forwarded to either Cloudwatch or SQS (default) depending on the optional destination path parameter.

Usage

Producing

Producing log messages is done by sending https requests. These should be a post with the body being the json format of a standard Python LogRecord (i.e. you should be able to call logging.makeRecord(**record) on it).

POST /logs/{destination}
  {
    "name": "foo",
    "level": "INFO",
    "pathname": "/home/user/Foo.py",
    "lineno": 1337,
    "message": "foo",
    "args": null,
    "exc_info": null,
    "func": "Foo.foo",
    "sinfo": ""
  }

Consuming

Consuming log messages can be done via the Cloudwatch interface, or if using SQS, via the Python REPL. Consuming a message deletes it from the SQS queue.

from SQSLogger import SQSLogger
sl = SQSLogger()
sl.consume([name])

Metadata

Release files for AWSCloudLogger 0.0.2

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

Built distribution (wheel)

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

Release files / AWSCloudLogger-0.0.2-py3-none-any.whl

Download URL AWSCloudLogger-0.0.2-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1834604ff9584a55ea783b0dd582de9a84463863dfd0cb7b95ca255e506ab877
BLAKE2b-256 checksum
How to use checksums
a70315531b17b52a733cf459fb8919d0e57d63d205439a554dc5df871fb29c2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

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