-
Hi, http: TLS handshake error from This happens if requesting software does not support TLS1.2 or 1.3 or accessing my site using IP directly (not with domain name). This is all attackers, scanners and bots. Not my clients. So far I do not use any logger middleware (except for debugging). Thus I use the default logger established after echo instance was created. It logs to regular log (stdout) and I inspect it with journalctl (I run as a systemd daemon). How can I stop it from logging messages beginning with http: TLS handshake error from? But keep the rest? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I think those messages are logged by http server logger. You could try to set log.SetOutput(ioutil.Discard) This is how you can set func main() {
e := echo.New()
s := http.Server{
Addr: ":8082",
Handler: e,
ErrorLog: nil, // set here logger to no-op logger
}
if err := s.ListenAndServe(); err != http.ErrServerClosed {
log.Fatal(err)
}
} and here is example for autoTLS with http.Server https://echo.labstack.com/cookbook/auto-tls/#server check |
Beta Was this translation helpful? Give feedback.
I think those messages are logged by http server logger. You could try to set
http.Server.ErrorLog
or global logger to discard inputThis is how you can set
ErrorLog
and here is example for autoTLS with http.Server https://echo.labstack.com/cookbook/auto-tls/#server check
customHTTPServer
function