I currently have a long running application on an embedded Linux environment and
ID: 658977 • Letter: I
Question
I currently have a long running application on an embedded Linux environment and all debug messages are currently being outputted to stdout using printf. This isn't ideal for special users who actually need to use the terminal.
Is there is a way to output to a pseudo-device file, a custom stderr or some type of unhooked stream so a live stream can be viewed if users decide to open it up in a file viewer or is there a better way to go about this?
I have thought about just logging all the debug messages to a file but I want to avoid an issue if the application is left running for days and days on end and the log file is left to fill up to some unmanageable size.
Explanation / Answer
The usual solution is to log to a file, and to use log rotation. You can implement the rotation yourself, or use a daemon like logrotate.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.