mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
transfer logs: add FTP mode
This commit is contained in:
@@ -259,8 +259,10 @@ func ErrorToConsole(format string, v ...interface{}) {
|
||||
}
|
||||
|
||||
// TransferLog logs uploads or downloads
|
||||
func TransferLog(operation, path string, elapsed int64, size int64, user, connectionID, protocol, localAddr, remoteAddr string) {
|
||||
logger.Info().
|
||||
func TransferLog(operation, path string, elapsed int64, size int64, user, connectionID, protocol, localAddr,
|
||||
remoteAddr, ftpMode string,
|
||||
) {
|
||||
ev := logger.Info().
|
||||
Timestamp().
|
||||
Str("sender", operation).
|
||||
Str("local_addr", localAddr).
|
||||
@@ -270,8 +272,11 @@ func TransferLog(operation, path string, elapsed int64, size int64, user, connec
|
||||
Str("username", user).
|
||||
Str("file_path", path).
|
||||
Str("connection_id", connectionID).
|
||||
Str("protocol", protocol).
|
||||
Send()
|
||||
Str("protocol", protocol)
|
||||
if ftpMode != "" {
|
||||
ev.Str("ftp_mode", ftpMode)
|
||||
}
|
||||
ev.Send()
|
||||
}
|
||||
|
||||
// CommandLog logs an SFTP/SCP/SSH command
|
||||
|
||||
Reference in New Issue
Block a user