From 8a974a4f8f1628c0b74c3a19cb8f2d0b48123cca Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 17 Aug 2021 10:51:26 -0600 Subject: logging: Warn for deprecated single_field encoder --- caddytest/integration/reverseproxy_test.go | 6 +++--- modules/caddyhttp/reverseproxy/caddyfile.go | 2 +- modules/logging/encoders.go | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/caddytest/integration/reverseproxy_test.go b/caddytest/integration/reverseproxy_test.go index e6aff87..422f671 100644 --- a/caddytest/integration/reverseproxy_test.go +++ b/caddytest/integration/reverseproxy_test.go @@ -371,7 +371,7 @@ func TestReverseProxyHealthCheck(t *testing.T) { reverse_proxy { to localhost:2020 - health_path /health + health_uri /health health_port 2021 health_interval 2s health_timeout 5s @@ -426,7 +426,7 @@ func TestReverseProxyHealthCheckUnixSocket(t *testing.T) { reverse_proxy { to unix/%s - health_path /health + health_uri /health health_port 2021 health_interval 2s health_timeout 5s @@ -481,7 +481,7 @@ func TestReverseProxyHealthCheckUnixSocketWithoutPort(t *testing.T) { reverse_proxy { to unix/%s - health_path /health + health_uri /health health_interval 2s health_timeout 5s } diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go index 8bbdf5e..c7f555f 100644 --- a/modules/caddyhttp/reverseproxy/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/caddyfile.go @@ -61,7 +61,7 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) // lb_try_interval // // # active health checking -// health_path +// health_uri // health_port // health_interval // health_timeout diff --git a/modules/logging/encoders.go b/modules/logging/encoders.go index 8b2b44c..1b5f4a6 100644 --- a/modules/logging/encoders.go +++ b/modules/logging/encoders.go @@ -135,6 +135,7 @@ func (SingleFieldEncoder) CaddyModule() caddy.ModuleInfo { // Provision sets up the encoder. func (se *SingleFieldEncoder) Provision(ctx caddy.Context) error { + caddy.Log().Named("caddy.logging.encoders.single_field").Warn("the 'single_field' encoder is deprecated and will be removed soon!") if se.FallbackRaw != nil { val, err := ctx.LoadModule(se, "FallbackRaw") if err != nil { -- cgit v1.2.3