Kaynağa Gözat

failed connection logs: rename host to client_ip

Nicola Murino 5 yıl önce
ebeveyn
işleme
74367a65cc
2 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 2 2
      README.md
  2. 1 1
      logger/logger.go

+ 2 - 2
README.md

@@ -455,8 +455,8 @@ The logs can be divided into the following categories:
 - **"connection failed logs"**, logs for failed attempts to initialize a connection. A connection can fail for an authentication error or other errors such as a client abort or a time out if the login does not happen in two minutes
     - `sender` string. `connection_failed`
     - `level` string
-    - `username`, string. Can be empty if the client open the connection and don't try to login
-    - `host` string.
+    - `username`, string. Can be empty if the connection is closed before an authentication attempt
+    - `client_ip` string.
     - `login_type` string. Can be `public_key`, `password` or `no_auth_tryed`
     - `error` string. Optional error description
 

+ 1 - 1
logger/logger.go

@@ -170,7 +170,7 @@ func ConnectionFailedLog(user, ip, loginType, errorString string) {
 	logger.Debug().
 		Timestamp().
 		Str("sender", "connection_failed").
-		Str("host", ip).
+		Str("client_ip", ip).
 		Str("username", user).
 		Str("login_type", loginType).
 		Str("error", errorString).