OPNsense Forum

English Forums => 25.7 Series => Topic started by: The_Istar on August 25, 2025, 02:42:43 PM

Title: Caddy - Access log not showing
Post by: The_Istar on August 25, 2025, 02:42:43 PM
I just changed my Log HTTP Access in JSON Format setting from enabled to disabled as I wanted to access requests to show up in my normal logs in the Opnsense GUI as I do need the json logs anymore.

However, it seems none of my access requests show up in the Caddy logs.

Under log settings log level is set to: DEBUG and Log HTTP Access in JSON Format is deselected.
Under the Domain in question HTTP Access Log is enabled.
If it matters, this is a wildcard domain with DNS validation. Protocol is HTTPS.

The sites I reach work just fine. It is just that my access does not show in the logs at all.

I restarted the service already, disabled and enabled it and ever rebooted OPNSense totally. Yet no success.

Anybody any idea?

Title: Re: Caddy - Access log now showing
Post by: Monviech (Cedrik) on August 25, 2025, 03:14:11 PM
can you share your currently generated caddyfile?

Just omit all api keys, passwords, and use example.com as your base domain.
Title: Re: Caddy - Access log now showing
Post by: The_Istar on August 25, 2025, 03:29:39 PM
There you go.
And thanks already.
Title: Re: Caddy - Access log not showing
Post by: Monviech (Cedrik) on August 25, 2025, 06:46:44 PM
It looks like there is something wrong with the log generation. I would expect more include lines, for each subdomain one.

include http.log.access.9f05cc56-1da2-4acd-91b3-09fd96d47fe3

Sounds like a bug in the log directive generation in the template.

Can you open a github ticket for me?

https://github.com/opnsense/plugins/issues
Title: Re: Caddy - Access log not showing
Post by: The_Istar on August 25, 2025, 09:31:03 PM
Done.

https://github.com/opnsense/plugins/issues/4914 (https://github.com/opnsense/plugins/issues/4914)

Title: Re: Caddy - Access log not showing
Post by: The_Istar on September 02, 2025, 01:12:59 PM
Thanks! I saw you closed the github issue.

Anyway to get this installed already?
Or is there an update to Opnsense that includes this imminent anyway?
Title: Re: Caddy - Access log not showing
Post by: Monviech (Cedrik) on September 02, 2025, 02:12:35 PM
You can install this via

opnsense-patch -c plugins https://github.com/opnsense/plugins/commit/2c4e372109bf59184bf569e122fc59c59fb57512
Afterwards "Apply" once in the Caddy GUI.

Thanks for testing.

Inclusion in an update will be sometime next week. But if you can test it now I know its fine. :)
Title: Re: Caddy - Access log not showing
Post by: The_Istar on September 02, 2025, 02:25:21 PM
Tested and confirmed working.

Thanks!
Title: Re: Caddy - Access log not showing
Post by: Monviech (Cedrik) on September 02, 2025, 02:26:30 PM
Nice thanks, was a typo from when I changed something a while back.
Title: Re: Caddy - Access log not showing
Post by: The_Istar on September 02, 2025, 02:32:01 PM
Human error, it happens.
Who hasn't spend hours debugging an issue, only for someone else suddenly pointing out that you missed a coma somewhere.
Still, better a typo once in a while than just blindly copy pasting AI output. :)