Docs
ufile
Console Guide
Logging Management

Log Management

When users access US3 files, a large number of access logs are generated, and the log management function can be enabled. After enabling, the access log of this space will be stored in the user-specified space with a fixed name at an interval of about 2 minutes. The request log will be transmitted to your bucket as much as possible, but there may be a small amount of log delay or loss.

Setting Log Storage

Select the corresponding space and click the log management button in the right-side operations 1

Click the button to enable log storage 2

Select the log storage space and fill in the log prefix. The log storage space defaults to the current space, and the log prefix defaults to ufile-log/. The prefix can be empty. Example: Fill in the prefix as ufile-log/2019/, the generated log will be stored in the filled directory.

Log Naming Rule

\ <TargetPrefix\> \ <SourceBucket\> - YYYY-MM-DD-HH-UniqueString.csv

Explanation for naming rule fields:

FieldExplanation
TargetPrefixSpecified by the user, represents the prefix of the name for storing the access log record, it can be empty
YYYY-MM-DD-HHThe year, month, day, and hour in Arabic numerals when the log was created
UniqueStringA string generated by the system, used to uniquely identify the Log file

The name example of the storage space access log is as follows: ufile-log/SourceBucket-2018-10-22-08-537928a6-8be3-462c-a93c-b531028fe3fb.csv

Log Format and Example

Logs are provided in CSV format. The first line of the log is the log header, corresponding to the meaning of each column in the following log text. The log header is as follows: Action,Bucket,Key,Host,UserAgent,RemoteIP,Referer,HttpStatus,TimeStamp,CostTime,ErrCode,ErrMsg,IsUCDN,FileSize,StorageClass,CreatedTime,RequestSize,TokenPublicKey,SessionId

Field Description

FieldExampleExplanation
ActionLIST_OBJECTSRequested interface
Bucketmy-bucketRequested bucket
Keyexample-objectRequested object name
Hostexample-bucket.cn-bj.example.comTarget domain name for the request
UserAgentcurl/7.77.0HTTP User-Agent Header
RemoteIP192.168.0.1IP of the requester
Refererhttps://console.ucloud-global.com/Referer header of the request in HTTP
HttpStatus200HTTP Status Code
TimeStamp1654653684Timestamp for the request
CostTime13Time cost of the request (in ms)
ErrCode0Error code of the request (0 means no error occurred)
ErrMsgsuccessError message of the request (success means the request is successful)
IsUCDNfalseWhether UCDN is used
FileSize1024File size in bytes. For non-GET requests, this value is 0
StorageClassSTANDARDFile storage type. STANDARD stands for Standard Storage, IA stands for Infrequent Access Storage, ARCHIVE stands for Archive Storage. For non-GET requests, this value is UNKNOWN
CreatedTime1654653681Time of file creation. For non-GET requests, this value is 0
RequestSize4096Size of the upload/download request. It only makes sense when executing PutFile, PostFile, UploadPart, GetFile requests
TokenPublicKeyToken_xxxx_xxx_xxxPublic key of token used by the request
SessionIdd0e27b98-6d78-4a8d-ac3c-9dd3e3e7b405Session id of the request

Log Example

Action,Bucket,Key,Host,UserAgent,RemoteIP,Referer,HttpStatus,TimeStamp,CostTime,ErrCode,ErrMsg,IsUCDN,FileSize,StorageClass,CreatedTime,RequestSize,TokenPublicKey,SessionId
LIST_OBJECTS,example-bucket,,example-bucket.cn-bj.example.com,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML like Gecko) Chrome/102.0.5005.61 Safari/537.36,10.75.220.2,https://console.ucloud-global.com/,200,1654653684,13,0,success,false,0,UNKNOWN,0, 0, Token_ABCDEFG, d0e27b98-6d78-4a8d-ac3c-9dd3e3e7b405
OPTIONS,example-bucket,,example-bucket.cn-bj.example.com,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML like Gecko) Chrome/102.0.5005.61 Safari/537.36,10.75.220.2,https://console.ucloud-global.com/,200,1654653684,0,0,success,false,0,UNKNOWN,0, 0, Token_ABCDEFG, d0e27b98-6d78-4a8d-ac3c-9dd3e3e7b405
OPTIONS,example-bucket,,example-bucket.cn-bj.example.com,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML like Gecko) Chrome/102.0.5005.61 Safari/537.36,10.75.220.2,https://console.ucloud-global.com/,200,1654653681,0,0,success,false,0,UNKNOWN,0, 0, Token_ABCDEFG, d0e27b98-6d78-4a8d-ac3c-9dd3e3e7b405
MPUT_DATA,example-bucket,2022-05-26-17-00000000.csv,example-bucket.example.com,Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML like Gecko) Chrome/110.0.0.0 Safari/537.36,106.75.220.2,https://console.ucloud-global.com/,200,1676257320,303,0,success,false,0,UNKNOWN,0,325,Token_xxxxxxxxxxxx,9bbff734-3555-4d29-a75b-e4221f1a3e9c