talaia-labs / rust-teos

The Eye of Satoshi - Lightning Watchtower
https://talaia-labs.github.io/talaia.watch/
MIT License
134 stars 63 forks source link

Log to file #88

Open sr-gi opened 2 years ago

sr-gi commented 2 years ago

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.

mariocynicys commented 2 years ago

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

sr-gi commented 2 years ago

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 commented 1 year ago

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

sr-gi commented 1 year ago

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?

mariocynicys commented 1 year ago

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