Trying to get access logs written as per log (Caddyfile directive) — Caddy Documentation
And then converting it from caddyfile to json (I prefer the former for quick editing). The conversion doesn’t work, so either I’m placing it wrong, something has changed or, as mentioned in other places, this can’t be done in Caddyfile.
Please be gentle, this is literally my 2nd day with caddy. I’m happy to have it working, but w/o fail2ban on top of it, I’ll soon be flooded
4. Error messages and/or full log output:
2020/03/23 21:56:06.071 INFO using adjacent Caddyfile
adapt: Caddyfile:8: unrecognized directive: output
5. What I already tried:
moving / nesting the log block in different places, adding more details like format or level.
The log directive is a standard directive, and all directives appear inside site blocks. The only things outside of them are snippets and the global options block at the start of the file.
Thanks a lot for help. Indeed I got rid of the adapt error, still… The log isn’t written to the file specified. I tried different locations and different paths. It’s just not being created.
???
I think the roll_size is wrong. I think you want 10MiB. I think 10 is actually 10 bytes in this case That might be what’s preventing it from being written altogether.
I changed that, but it didn’t help. What’s interesting, adopting the file produces a json with this section: "logs":{}}}}
Does it mean it simply not getting imported / converted?
ps. Re. the size of logs… It’s funky In some places the docs says it could be 100MiB, in some other places 1gb; so not clear what’s the valid formatting.