Flush error logs before process exits
Author: gloomsCreated Aug 27, 2026Updated Aug 27, 2026
Issue Details
Config errors are not written to stdout (or similar) before the process exits. The issue is simply that the error is logged but not flushed so the information is never written.
The proper fix would probably be to just add a flush after this line: https://github.com/caddyserver/caddy/blob/master/cmd/cobra.go#L156
Or, move the error logging to before the flushing that happens: https://github.com/caddyserver/caddy/blob/master/cmd/commandfuncs.go#L254
Since this happens in more than one place the proper way would probably be to just ensure all buffered messages are flush prior to the process terminating.
Assistance Disclosure
AI not used
If AI was used, describe the extent to which it was used.
No response
Source: caddyserver/caddy