Skip to content

When using with ssl and 443 port it can't log  #9

Description

@saatsazov

I understand this project is not maintained, but decided to create an issue maybe someone will have similar problem.

I set up ssl server and this logger.


opts := httplog.Opts{}

// opts.HTTPUtil.DumpRequest.Enable = true
// opts.HTTPUtil.DumpRequest.Body = true
opts.Log2StdOut.Response.Enable = true
opts.Log2StdOut.Response.Options.Body = true

opts.Log2StdOut.Request.Enable = true
opts.Log2StdOut.Request.Options.Body = true
// opts.Log2DB.Response.Header = true
// opts.Log2DB.Response.Body = true

s.Use(httplog.LogHandler(zerolog.Logger, nil, &opts))

if err := http.ListenAndServeTLS(":443", "certificates/fullchain.pem", "certificates/privkey.pem", s); err != nil {
	log.Fatal(err)
}

{"level":"error","error":"address localhost: missing port in address","time":"2023-06-10T13:47:05+02:00"}

I've debug a bit and tracked down it here: https://github.com/gilcrest/httplog/blob/master/tracker.go#L104

So I'll try to find another logger but decided to report anyway

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions