Half an hour later filling it in perfectly and this submission template is giving me the hump…
“Sorry, new users can only put 4 links in a post. Remember to enclose Caddyfiles and logs with backticks (```) on empty lines immediately before and after the text - domains posted this way do not count as links.”
I’ve only pasted the link to the Caddy docs.
Anyway…
I’m trying to change the format of the time and date in my logs to ISO 8601 but cannot for the life of me a) figure out the documentation or b) find any working examples online.
I can see that I need to enter the below in my Caddyfile, but where in the site blocks does it go and what is the “encoder_module”?
Also, would I place “ISO8601” in the place of ?
format <encoder_module> {
time_format <format>
}
All my attempts to guess it return;
reload: adapting config using caddyfile: parsing caddyfile tokens for 'log': Caddyfile:21 - Error during parsing: getting log encoder module named 'time_format': module not registered: caddy.logging.encoders.time_format
Please help. I’ve just switched from NGINX to Caddy and desperately trying to make it fit.
Thanks, Francis. That worked a treat. I even decided to try “wall” as that looked better for readability, and it is. Although I can’t see how it works from the above snippet. Never mind, the data and time looks great now.
But I have also noticed that this seems to have cancelled out the format single_field common_log which works without the time_format block, so I now have the wall-of-text default logging.