2.8 KiB
2.8 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:
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
stringelapsed_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
orSCP
- "command logs", SFTP/SCP command logs:
sender
string.Rename
,Rmdir
,Mkdir
,Symlink
,Remove
,Chmod
,Chown
,Chtimes
,SSHCommand
level
stringusername
, 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 emptyssh_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
stringremote_addr
string. IP and port of the remote clientproto
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.login_type
string. Can bepublickey
,password
,keyboard-interactive
orno_auth_tryed
error
string. Optional error description