Urgent.News

600+ sources. One page. See who else covered it.

Editions

Tech

Seeing Your Bot's Crash Logs Without SSHing Into the Server

How StayPresent v1.6.0 captures bot stdout/stderr into a live log tail on the status page, so you can debug a crash without shell access. Seeing Your Bot's Crash Logs Without SSHing Into the Server When a bot crashes on a managed PaaS platform, your options for seeing why are usually limited to whatever log viewer the platform itself provides — which can be slow to load, hard to search, or…

StayPresent v1.6.0 introduced the ability to capture a bot's standard output and error logs into a live log tail directly on the status page, allowing developers to debug crashes without needing to SSH into the server. Previously, bot output was only streamed to the parent process's console and was difficult to search or view after a crash had already occurred.

The new ring buffer feature keeps recent log lines stored for easy access while preventing excessive memory usage from long-running bots. This output is now displayed on the status page under the admin view, where a crash incident entry includes a recent log tail alongside the exit code. This change makes it easier to see what the bot was doing right before it crashed, without requiring direct server access.

The upgraded version of StayPresent automatically captures bot subprocess output into a fixed-size ring buffer, retaining recent lines and discarding older ones as new output arrives. This ensures memory usage remains bounded regardless of how much a bot logs or how long it runs. When viewing the logs, bots calling sys.stdout.isatty() will now consistently return False, as subprocesses are launched with piped streams.

This means any bot code that relied on isatty() returning True for an interactive shell would need to be adjusted to degrade gracefully under StayPresent. While this log capture is valuable for debugging intermittent crashes on platforms where SSH access is limited, it's important to note that the logs are retained for a bounded period and not for long-term retention.

Developers are advised to pair this feature with their platform's own logging or an external log aggregator for comprehensive log management.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.

Read the original at dev.to →

More in Tech