The log file is a stream of JSON structs. Each struct has a sender
field that identifies the log type.
The logs can be divided into the following categories:
- "app logs", internal logs used to debug SFTPGo:
sender
string. This is generally the package name that emits the logtime
string. Date/time with millisecond precisionlevel
stringmessage
string
- "transfer logs", SFTP/SCP transfer logs:
sender
string.Upload
orDownload
time
string. Date/time with millisecond precisionlevel
stringlocal_addr
string. IP/port of the local address the connection arrived on. For FTP protocol this is the address for the control connection. For example127.0.0.1:1234
remote_addr
string. IP and, optionally, port of the remote client. For example127.0.0.1:1234
or127.0.0.1
elapsed_ms
, int64. Elapsed time, as milliseconds, for the upload/downloadsize_bytes
, int64. Size, as bytes, of the download/uploadusername
, stringfile_path
stringconnection_id
string. Unique connection identifierprotocol
string.SFTP
,SCP
,SSH
,FTP
,HTTP
,DAV
,DataRetention
ftp_mode
, string.active
orpassive
. Included only forFTP
protocol
- "command logs", SFTP/SCP command logs:
sender
string.Rename
,Rmdir
,Mkdir
,Symlink
,Remove
,Chmod
,Chown
,Chtimes
,Truncate
,SSHCommand
level
stringlocal_addr
string. IP/port of the local address the connection arrived on. For example127.0.0.1:1234
remote_addr
string. IP and, optionally, port of the remote client. For example127.0.0.1:1234
or127.0.0.1
username
, stringfile_path
stringtarget_path
stringfilemode
string. Valid for senderChmod
otherwise emptyuid
integer. Valid for senderChown
otherwise -1gid
integer. Valid for senderChown
otherwise -1access_time
datetime as YYYY-MM-DDTHH:MM:SS. Valid for senderChtimes
otherwise emptymodification_time
datetime as YYYY-MM-DDTHH:MM:SS. Valid for senderChtimes
otherwise emptysize
int64. Valid for senderTruncate
otherwise -1ssh_command
, string. Valid for senderSSHCommand
otherwise emptyconnection_id
string. Unique connection identifierprotocol
string.SFTP
,SCP
orSSH
- "http logs", REST API logs:
sender
string.httpd
level
stringlocal_addr
string. IP/port of the local address the connection arrived on. For example127.0.0.1:1234
remote_addr
string. IP and, optionally, port of the remote client. For example127.0.0.1:1234
or127.0.0.1
proto
string, for exampleHTTP/1.1
method
string. HTTP method (GET
,POST
,PUT
,DELETE
etc.)user_agent
stringuri
string. Full uriresp_status
integer. HTTP response status coderesp_size
integer. Size in bytes of the HTTP responseelapsed_ms
int64. Elapsed time, as milliseconds, to complete the requestrequest_id
string. Unique request identifier
- "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 timeout if the login does not happen in two minutes
sender
string.connection_failed
level
stringusername
, string. Can be empty if the connection is closed before an authentication attemptclient_ip
string.protocol
string. Possible values areSSH
,FTP
,DAV
login_type
string. Can bepublickey
,password
,keyboard-interactive
,publickey+password
,publickey+keyboard-interactive
orno_auth_tryed
error
string. Optional error description