I’d like to have log files for each subdomain that is proxied. I haven’t figured out how to do this. I want the Caddy log file for the Caddy-only stuff, then subdomain logs for the subdomain-specific stuff.
I’ve tried using a logging function that creates a log file based on a passed in filename, and I tried a log statement in the server block, but neither creates any specific log file.
You didn’t specify a path to the file, so Caddy would try to write it to the current working directory. Where that is depends on how you started Caddy.
Maybe I should ask this way - is logging per subdomain (server) possible? Caddy doesn’t complain about the config file. Is my config valid? All I know is it doesn’t produce anything new or different than w/o the server block directives.
The Caddy process probably doesn’t have permission to write to that location. I can’t really help with that part, permissions on Windows is not something I have much experience with.
Write permissions is not the problem. (If Caddy couldn’t write, I’d hope it would show some kind of error.)
I had to escape the backslash because Caddy would error if I didn’t. Even Caddy knows to do it: redirected default logger {"from": "stderr", "to": "D:\\BIN\\caddy\\caddy.log"}
Then it sounds like something is broken, at least on Windows. Or maybe my expectations are incorrect. What would be logged in the per server log file?