mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-11-23 22:04:50 +02:00
4.0 KiB
4.0 KiB
Logs
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:
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 forFTPprotocol
- "command logs", SFTP/SCP command logs:
senderstring.Rename,Rmdir,Mkdir,Symlink,Remove,Chmod,Chown,Chtimes,Truncate,Copy,SSHCommandlevelstringlocal_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 if the login does not happen in two minutes
senderstring.connection_failedlevelstringtimestring. 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