File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,15 @@ https://{{ caddy.addresses.webhook }} {
2222http://{{ caddy.addresses.webhook }} {
2323{% endif %}
2424
25+ # Include access logs when an error occurs, since we mask any internal errors
26+ # from escaping to the outside world, but otherwise don't log.
27+ log {
28+ output discard
29+ }
30+ log errors {
31+ no_hostname
32+ }
33+
2534 root * {{ caddy.site_dir }}
2635
2736 # https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#delivery-headers
@@ -41,6 +50,9 @@ http://{{ caddy.addresses.webhook }} {
4150 # Don't leak out internal problems.
4251 @error status 4xx 5xx
4352 handle_response @error {
53+ log_name errors
54+ log_append api_error_code {rp.status_code}
55+ log_append api_error_text {rp.status_text}
4456 error 400
4557 }
4658 }
@@ -51,6 +63,9 @@ http://{{ caddy.addresses.webhook }} {
5163 # Don't leak out internal problems.
5264 @error status 4xx 5xx
5365 handle_response @error {
66+ log_name errors
67+ log_append api_error_code {rp.status_code}
68+ log_append api_error_text {rp.status_text}
5469 error 503
5570 }
5671 }
You can’t perform that action at this time.
0 commit comments