rust-teos icon indicating copy to clipboard operation
rust-teos copied to clipboard

Log to file

Open sr-gi opened this issue 3 years ago • 5 comments

simple_logger doesn't seem to allow logging to a file. Currently, we can run teos like:

teosd >> teos.log

And that would do, but it may be nice to have this out of the box. Find a simple and lightweight replacement for simple_logger that allows this and do the proper changes.

sr-gi avatar Aug 09 '22 09:08 sr-gi

In defense of simple_logger since it's indeed a very simple, lightweight crate: This might be a fairly simple feature to add.

mariocynicys avatar Aug 09 '22 11:08 mariocynicys

Looks like this may be harder than it looks, but it has been requested as a feature, but the issue was closed :( https://github.com/borntyping/rust-simple_logger/issues/21

The general solution is redirecting on cmd https://github.com/borntyping/rust-simple_logger/issues/16

sr-gi avatar Aug 15 '22 10:08 sr-gi

I'm also going to link #176 since this is somewhat of a solution for it

sr-gi avatar Jan 23 '23 22:01 sr-gi

I think we should keep this, but maybe remove the good first issue tag and tag it as docs or something.

There is currently a solution for this for Linux via systemd and you can also go the teosd >> teos.log route.

Thoughts @mariocynicys?

sr-gi avatar Feb 16 '23 09:02 sr-gi

To me, this would only make sense if the tower can be ran as a detached daemon. It's cleaner to start teosd in: teosd --daemon --logfile FILE fashion (and actually have daemon and logfile specified in the config instead) than teosd --daemon >> FILE.

But since I start my tower like teosd >> FILE & anyway, where the log file is specified isn't an issue in that regard since I have to write that trailing ampersand. This might be a bit of a biased opinion tbh.

side note: sorry I don't like systemd services :p

mariocynicys avatar Feb 16 '23 11:02 mariocynicys