Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 11, 22:15 UTC
http: Make logger first, before TLS provisioning (#7198)
Francis Lavoie committed
Aug 22, 2025 at 16:24 UTC
16fe83c7afe2152b0bb53ae35078a28f87e6dcf2
1 file changed
+4
-2
modules/caddyhttp/app.go
+4
-2
@@ -170,13 +170,15 @@ func (App) CaddyModule() caddy.ModuleInfo {
170
// Provision sets up the app.
171
func (app *App) Provision(ctx caddy.Context) error {
172
// store some references
173
+ app.logger = ctx.Logger()
174
+ app.ctx = ctx
175
+
176
+ // provision TLS and events apps
177
tlsAppIface, err := ctx.App("tls")
178
if err != nil {
179
return fmt.Errorf("getting tls app: %v", err)
180
}
181
app.tlsApp = tlsAppIface.(*caddytls.TLS)
178
- app.ctx = ctx
179
- app.logger = ctx.Logger()
182
183
eventsAppIface, err := ctx.App("events")
184
if err != nil {