No Coder Logs
Taking this over from general.
What I want to do: Monitor Coder Web Logins with fail2ban just to be sure, but I can't find the logs anywhere.
System: Debian Bullseye, Coder running as Systemd Service.
Nothing else is running on the system despite what's neccessary for coder itself and standard system tools like ssh server.
Running
returns nothing.
Dropping the -f at least brings up something:
But that is all. I also checked syslog, auth.log and systemctl status of coder, but theres nothing there as well.
15 Replies
The
-f
will only tail the logs, but removing it should dump all logs from all time for the Coder service.Yeah it's really weird. Like there is nothing being logged at all by coder.
Oh, seems like that's showing commands you have ran actually... that's super odd.
Yeah I ran both. It was weird already when I set up the new system and had some errors in the coder.env and all it said was "failed to start", no error log at all.
Are you sure it's running with systemd? I'm not sure where else the logs would go.
Yeah, definitely. But I'll double-check tomorrow.
Cool, just let me know!
Just checked, but yeah, running as systemd service:
No more Ideas anyone? 😦
Does secifying
.service
help? I.e. sudo journalctl -u coder.service
Same output as without
.service
I also just tried again to login with wrong credentials, but nothing in the logs, no matter if with/without .service
added.Do you have verbose enabled in
coder.env
?
You can add CODER_VERBOSE=true
to /etc/coder.d/coder.env
and restart the coder service.
Then you should see something like this:
Ok, adding verbose does work, now I can see login attempts.
But having it log everything like that might not be great in the long run. Can I tweak it somehow so logins aren't just available with logging everything?
One option would be to modify the code and add a second condition, like:
Here: https://github.com/coder/coder/blob/a4ca8ffa651f4b0cd44b1b77d002c21bda877593/coderd/httpmw/logger.go#L56-L58
But other than that, it's not currently possible, I'm afraid. Would you care to open up a feature request on the issue tracker describing what you want to achieve and why?
Oh well, my coding experience is basically none, but I can give it a try. Thanks either way! And sure, I'll do that once I have a few minutes. I'm not entirely sure it is necessary, but having the option to add another security layer can't hurt 🙂 I noticed I'll have to update caddy as well then since it doesn't forward the real IP in the basic setup.
Thanks for looking into it!
Marked the thread as resolved.