Logs
SFTPGo logs a stream of JSON structs. Each struct has a sender field that identifies the log type.
SFTPGo logging options are set either by cli options or environment variables, not in the configuration file. More details.
The logs can be divided into the following categories:
app logs, internal logs used to debug SFTPGo:
senderstring. This is generally the package name that emits the logtimestring. Date/time with millisecond precisionlevelstringconnection_id, string, optionalmessagestring
transfer logs, SFTP/SCP transfer logs:
senderstring.UploadorDownloadtimestring. Date/time with millisecond precisionlevelstringlocal_addrstring. 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:1234remote_addrstring. IP and, optionally, port of the remote client. For example127.0.0.1:1234or127.0.0.1elapsed_ms, int64. Elapsed time, as milliseconds, for the upload/downloadsize_bytes, int64. Size, as bytes, of the download/uploadusername, stringfile_pathstringconnection_idstring. Unique connection identifierprotocolstring.SFTP,SCP,SSH,FTP,HTTP,HTTPShare,DAV,DataRetention,EventActionftp_mode, string.activeorpassive. Included only forFTPprotocolerror, string. Included if there is a transfer error
command logs, SFTP/SCP command logs:
senderstring.Rename,Rmdir,Mkdir,Symlink,Remove,Chmod,Chown,Chtimes,Truncate,Copy,SSHCommandlevelstring-local_addrstring. IP/port of the local address the connection arrived on. For example127.0.0.1:1234remote_addrstring. IP and, optionally, port of the remote client. For example127.0.0.1:1234or127.0.0.1username, stringfile_pathstringtarget_pathstringfilemodestring. Valid for senderChmodotherwise emptyuidinteger. Valid for senderChownotherwise -1gidinteger. Valid for senderChownotherwise -1access_timedatetime as YYYY-MM-DDTHH:MM:SS. Valid for senderChtimesotherwise emptymodification_timedatetime as YYYY-MM-DDTHH:MM:SS. Valid for senderChtimesotherwise emptysizeint64. Valid for senderTruncateotherwise -1elapsed, int64. Elapsed time, as millisecondsssh_command, string. Valid for senderSSHCommandotherwise emptyconnection_idstring. Unique connection identifierprotocolstring.SFTP,SCP,SSH,FTP,HTTP,DAV,DataRetention,EventAction
http logs, REST API logs:
senderstring.httpdlevelstringtimestring. Date/time with millisecond precisionlocal_addrstring. IP/port of the local address the connection arrived on. For example127.0.0.1:1234remote_addrstring. IP and, optionally, port of the remote client. For example127.0.0.1:1234or127.0.0.1protostring, for exampleHTTP/1.1methodstring. HTTP method (GET,POST,PUT,DELETEetc.)request_idstring. Omitted in telemetry logsuser_agentstringuristring. Full uriresp_statusinteger. HTTP response status coderesp_sizeinteger. Size in bytes of the HTTP responseelapsed_msint64. Elapsed time, as milliseconds, to complete the requestrequest_idstring. 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
senderstring.connection_failedlevelstring.debugtimestring. Date/time with millisecond precisionusername, string. Can be empty if the connection is closed before an authentication attemptclient_ipstring.protocolstring. Possible values areSSH,FTP,DAVlogin_typestring. Can bepublickey,password,keyboard-interactive,publickey+password,publickey+keyboard-interactiveorno_auth_triederrorstring. Optional error description
login logs, logs for successful logins
senderstring.loginlevelstring.infotimestring. Date/time with millisecond precisionusername, string.ipstring.protocolstring.methodstring.connection_idstring. Optional.clientstring. Client software name if available.encrypted, booleaninfostring. Optional additional information.