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
Click the button to enable log storage
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:
Field | Explanation |
---|---|
TargetPrefix | Specified by the user, represents the prefix of the name for storing the access log record, it can be empty |
YYYY-MM-DD-HH | The year, month, day, and hour in Arabic numerals when the log was created |
UniqueString | A 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
Field | Example | Explanation |
---|---|---|
Action | LIST_OBJECTS | Requested interface |
Bucket | my-bucket | Requested bucket |
Key | example-object | Requested object name |
Host | example-bucket.cn-bj.example.com | Target domain name for the request |
UserAgent | curl/7.77.0 | HTTP User-Agent Header |
RemoteIP | 192.168.0.1 | IP of the requester |
Referer | https://console.ucloud-global.com/ | Referer header of the request in HTTP |
HttpStatus | 200 | HTTP Status Code |
TimeStamp | 1654653684 | Timestamp for the request |
CostTime | 13 | Time cost of the request (in ms) |
ErrCode | 0 | Error code of the request (0 means no error occurred) |
ErrMsg | success | Error message of the request (success means the request is successful) |
IsUCDN | false | Whether UCDN is used |
FileSize | 1024 | File size in bytes. For non-GET requests, this value is 0 |
StorageClass | STANDARD | File 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 |
CreatedTime | 1654653681 | Time of file creation. For non-GET requests, this value is 0 |
RequestSize | 4096 | Size of the upload/download request. It only makes sense when executing PutFile, PostFile, UploadPart, GetFile requests |
TokenPublicKey | Token_xxxx_xxx_xxx | Public key of token used by the request |
SessionId | d0e27b98-6d78-4a8d-ac3c-9dd3e3e7b405 | Session 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