🚀 Feature: Write logs to file
🔖 Feature description
Hello,
it would be a handy feature if the log was also written to a file and not just to the stdout.
🎤 Pitch
The log could be processed by other programs. For example, you could monitor failed logins with fail2ban and block the IP.
ill try to make somthing like this for u
ill try to make somthing like this for u
nvm it is not easy to add this because its using the logger from nextjs common without rewriting the whole logging system
you have still 2 ways of using fail2ban.
- using a reverse proxy like swag
swag is writing logs for all access to all backends. it generates "401" entries for a failauth in pingvin. this entry can be parsed in fail2ban nginx jail config. so the src failing ip is banned on the reverse proxy
- you can use the docker container json log (std output of authfails are here) caveat is that you have to script a stable link to the changing docker id json files. i.e. /var/lib/docker/containers/b5beece1189ec98d16a99dc57bc16726778d859f3dcdef14ddfe80b10683999e/b5beece1189ec98d16a99dc57bc16726778d859f3dcdef14ddfe80b10683999e-json.log
for me its running perfect with swag in docker container
fail2ban can use syslog too so if you use systemd to run pingvin you can simply set the systemd unit to log to syslog (if it's not already being done).
for docker, you can set the log driver to syslog and all the stdout log from the container will be sent to syslog, which fail2ban can pick up.