Skip to main content

log2mqtt

Simple Python program to publish standard input to an MQTT server on a desired topic.

Installation

The program can be installed using PIP.

pip install log2mqtt

Usage

Expected usage of the program is piping the standard output of a program you want to monitor the logs of into into the program. This looks something like:

my_program | python3 -m log2mqtt -s wss://mqtt.myserver.com:443 -u my_user -p my_pass -t /my_mqtt_topic

What Does It Do?

It publishes the standard output of the piped program to an MQTT server. Each break in the standard output is published as a new message and this program exits cleanly when the logged process terminates.

But Why?

I made a custom home assistant card which reads the sensor history of an MQTT sensor and renders it as a terminal, this allows me to monitor the logs of my scripts right in my home assistant instance without having to mess around with more complicated logging tools.

Metadata

Release files for log2mqtt 0.1.0

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

Source distribution (sdist)

Source distribution for log2mqtt 0.1.0
File Size Uploaded
log2mqtt-0.1.0.tar.gz 4.3 kB Details

Built distribution (wheel)

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

Total release size: 10.1 kB

Release files / log2mqtt-0.1.0.tar.gz

Download URL log2mqtt-0.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fb53886f2c6beb7901c51eb9282e115752e7ff98360bbbca87d372d92c4620bc
BLAKE2b-256 checksum
How to use checksums
5eb4822306ee2ebe37ea6d4671a9619e8139ea617c9001f2775032268a6a6de2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.10.16 Linux/6.10.14-linuxkit

Release files / log2mqtt-0.1.0-py3-none-any.whl

Download URL log2mqtt-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9ee58494ef2db74e396f4d193a921e8fea25234c3eecd6e346e346deed6278c
BLAKE2b-256 checksum
How to use checksums
78cb1966795a34b5ba4ac14dec7bc7d443efec916e8eb6f4fc38d8430b22c130
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.10.16 Linux/6.10.14-linuxkit

Release history Release notifications | RSS feed

This release

0.1.0 This release

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