Luzifer / ots

One-Time-Secret sharing platform with a symmetric 256bit AES encryption in the browser
https://ots.fyi
Apache License 2.0
463 stars 68 forks source link

How to redirect logging to a file #175

Closed mshedsilegx closed 7 months ago

mshedsilegx commented 7 months ago

I could not find a reference on how to store the ots output into a file, say /var/log/ots.log Is there a --log-file-path= option (I see only --log-level) If not, is this something we could had to the roadmap. Thank you.

Luzifer commented 7 months ago

Hmm starting with systemd you do have the logs in journald, starting with Docker you do have them in the Docker logs (and possibly in journald), with an initrc script you can just redirect them in shell (ots 2>/var/log..)…

Why do you need an extra flag so ots itself writes a file?

mshedsilegx commented 7 months ago

Yes, redirect works too, this is what I have currently. It is much easier to work with text logs than using journalctl for alerts and automation. I use systemd.

Luzifer commented 7 months ago

Hmm with systemd I'd suggest to use StandardError= for the unit.

To answer the question: OTS itself does not support configuring logging aside of the --log-level / LOG_LEVEL and it's not planned as redirecting the logs into different targets can easily be achieved through system-provided methods.

mshedsilegx commented 7 months ago

ok, thanks, closing