mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
add remote address to transfer and commands logs
This commit is contained in:
@@ -237,10 +237,11 @@ func ErrorToConsole(format string, v ...interface{}) {
|
||||
}
|
||||
|
||||
// TransferLog logs uploads or downloads
|
||||
func TransferLog(operation string, path string, elapsed int64, size int64, user string, connectionID string, protocol string) {
|
||||
func TransferLog(operation, path string, elapsed int64, size int64, user, connectionID, protocol, remoteAddr string) {
|
||||
logger.Info().
|
||||
Timestamp().
|
||||
Str("sender", operation).
|
||||
Str("remote_addr", remoteAddr).
|
||||
Int64("elapsed_ms", elapsed).
|
||||
Int64("size_bytes", size).
|
||||
Str("username", user).
|
||||
@@ -252,10 +253,11 @@ func TransferLog(operation string, path string, elapsed int64, size int64, user
|
||||
|
||||
// CommandLog logs an SFTP/SCP/SSH command
|
||||
func CommandLog(command, path, target, user, fileMode, connectionID, protocol string, uid, gid int, atime, mtime,
|
||||
sshCommand string, size int64) {
|
||||
sshCommand string, size int64, remoteAddr string) {
|
||||
logger.Info().
|
||||
Timestamp().
|
||||
Str("sender", command).
|
||||
Str("remote_addr", remoteAddr).
|
||||
Str("username", user).
|
||||
Str("file_path", path).
|
||||
Str("target_path", target).
|
||||
|
||||
Reference in New Issue
Block a user