The mod prints its packets to the server's standard output, and Docker's
syslog log driver sends them to Kafkatorio. kafkatorio-forward.py does
the same without Docker: it runs the server (or reads its output from a
pipe), prints the output as usual, and sends the mod's packets to the
syslog port in the same format as Docker, tagged with the token.
- the server keeps running when Kafkatorio is unreachable: packets wait in
a bounded buffer, and are sent after reconnecting
- before each send it checks Kafkatorio hasn't closed the connection, so
lines aren't silently lost in a dead socket
- Ctrl+C and SIGTERM are passed to the server once, so it saves and stops
- the token is read from a file or the environment, not the command line
- only the Python standard library
util-linux's logger can't be used instead: it rejects the token, which is
longer than syslog's 48 character APP-NAME limit.
Tested on Linux with a Factorio 2.0.77 server: packets arrive, the
forwarder reconnects when the syslog server restarts (no packets lost),
and the server saves when stopped.
The guide has a section for it, with a systemd service example, and the
README no longer says the Factorio server must run in Docker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>