mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20:55 +03:00
The common package defines the interfaces that a protocol must implement and contain code that can be shared among supported protocols. This way should be easier to support new protocols
2.7 KiB
2.7 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 precisionlevelstringmessagestring
- "transfer logs", SFTP/SCP transfer logs:
senderstring.UploadorDownloadtimestring. Date/time with millisecond precisionlevelstringelapsed_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.SFTPorSCP
- "command logs", SFTP/SCP command logs:
senderstring.Rename,Rmdir,Mkdir,Symlink,Remove,Chmod,Chown,Chtimes,SSHCommandlevelstringusername, 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 emptyssh_command, string. Valid for senderSSHCommandotherwise emptyconnection_idstring. Unique connection identifierprotocolstring.SFTP,SCPorSSH
- "http logs", REST API logs:
senderstring.httpdlevelstringremote_addrstring. IP and port of the remote clientprotostring, for exampleHTTP/1.1methodstring. HTTP method (GET,POST,PUT,DELETEetc.)user_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_failedlevelstringusername, string. Can be empty if the connection is closed before an authentication attemptclient_ipstring.login_typestring. Can bepublickey,password,keyboard-interactive,publickey+password,publickey+keyboard-interactiveorno_auth_tryederrorstring. Optional error description