http: Make logger first, before TLS provisioning (#7198)

This commit is contained in:
Francis Lavoie 2025-08-22 16:24:08 -04:00 committed by GitHub
parent 3723e89585
commit 16fe83c7af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -170,13 +170,15 @@ func (App) CaddyModule() caddy.ModuleInfo {
// Provision sets up the app.
func (app *App) Provision(ctx caddy.Context) error {
// store some references
app.logger = ctx.Logger()
app.ctx = ctx
// provision TLS and events apps
tlsAppIface, err := ctx.App("tls")
if err != nil {
return fmt.Errorf("getting tls app: %v", err)
}
app.tlsApp = tlsAppIface.(*caddytls.TLS)
app.ctx = ctx
app.logger = ctx.Logger()
eventsAppIface, err := ctx.App("events")
if err != nil {