File tree 1 file changed +15
-0
lines changed
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 }} {
22
22
http://{{ caddy.addresses.webhook }} {
23
23
{% endif %}
24
24
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
+
25
34
root * {{ caddy.site_dir }}
26
35
27
36
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#delivery-headers
@@ -41,6 +50,9 @@ http://{{ caddy.addresses.webhook }} {
41
50
# Don't leak out internal problems.
42
51
@error status 4xx 5xx
43
52
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}
44
56
error 400
45
57
}
46
58
}
@@ -51,6 +63,9 @@ http://{{ caddy.addresses.webhook }} {
51
63
# Don't leak out internal problems.
52
64
@error status 4xx 5xx
53
65
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}
54
69
error 503
55
70
}
56
71
}
You can’t perform that action at this time.
0 commit comments