Automated just in time read out of current terminal logs


I'm using OctoPrint version 1.8.1 on a Raspberry Pi 3. On the webinterface I can see in the terminal logs of send and recieve messages. The terminal shows me all information about the process, such as sensor values and sent G-code lines. These messages I want to read out. I found the file, where the terminal messages are saved in with timestamp, on the local file system of the Raspi. But the file includes all messages sent, but I want to have the current one, just in time it is sent, not a summary of all after a while. So my problem is, how can I get the currently sent/received message just in time without checking the changes in the local file every x milliseconds?
I also checked the documentation of the REST API, but I only found information about managing log files and not about getting single lines just in time out of the terminal.

Has anyone an idea how to solve this?
Thanks in advance for any help. If you need further information please let me know.

The only other way to access the serial logs would be to connect to OctoPrint's websocket - in the same way that the UI does.

There's some info on the push updates in the docs here:

It would require a login/authentication process, with an API key. An example with the JavaScript client would be here:

thank you very much, for the quick reply. That sounds helpful. I will try it out.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.