rustdesk / rustdesk-server

RustDesk Server Program
https://rustdesk.com/server
GNU Affero General Public License v3.0
6.73k stars 1.45k forks source link

Log to file #283

Open lonix1 opened 1 year ago

lonix1 commented 1 year ago

BACKGROUND

Rustdesk seems to log to stdout only, and thus to docker's built-in "json driver". The logs can be access like so:

PROBLEM

When the container is recycled, the logs are lost. The workaround is to use another logging tool, but that is unnecessary complexity, especially for small deployments.

Also, in general, the logs are not in a friendly format - it's much simpler, especially in small deployments, to simply have the log in a file that can be easily manipulated. Not everyone uses large complex logging apps and servers, etc.

SOLUTION

Many apps have an option to log to file as well. It would be nice if the log could be sent to a file instead of (or in addition to) stdout. If enabled, it could be written to /var/lib/rustdesk/app.log by default.

Personally, I would mount it as /var/log/rustdesk.log:/var/log/rustdesk.log so that I could have it on the host, use logrotate on it, add it to backups etc.

ALTERNATIVES

An unnecessarily complicated environment that includes log aggregation and monitoring, and who knows what else. For small servers that is overkill and hard to manage.

Additional context

Thank you for considering it!

paspo commented 6 months ago

https://github.com/rustdesk/rustdesk-server/discussions/371