How to view MinIO request logs for debugging
Use the minio client mc
like this:
mc admin trace myminio
where myminio
is an alias (URL + access key + secret key) which you can setup using mc alias ...
.
This will show output like
2022-03-27T18:22:22:000 [403 Forbidden] s3.GetObject minio.mydomain.com/api/v1/login 95.114.116.235 5.488ms ↑ 273 B ↓ 634 B
2022-03-27T18:22:23:000 [403 Forbidden] s3.ListObjectsV1 minio.mydomain.com/login 95.114.116.235 3.677ms ↑ 320 B ↓ 584 B
2022-03-27T18:24:19:000 [200 OK] s3.GetBucketLocation minio.mydomain.com/mybucket/?location= 192.168.192.2 6.089ms ↑ 211 B ↓ 444 B
2022-03-27T18:24:19:000 [200 OK] s3.GetBucketLocation minio.mydomain.com/mybucket/?location= 192.168.192.2 256µs ↑ 211 B ↓ 444 B
2022-03-27T18:24:19:000 [200 OK] s3.GetBucketLocation minio.mydomain.com/mybucket/?location= 192.168.192.2 251µs ↑ 211 B ↓ 444 B
2022-03-27T18:24:19:000 [200 OK] s3.GetBucketVersioning minio.mydomain.com/mybucket/?versioning= 192.168.192.2 407µs ↑ 211 B ↓ 414 B
2022-03-27T18:24:19:000 [404 Not Found] s3.GetBucketObjectLockConfig minio.mydomain.com/mybucket/?object-lock= 192.168.192.2 519µs ↑ 211 B ↓ 663 B
2022-03-27T18:24:19:000 [200 OK] s3.GetBucketLocation minio.mydomain.com/mybucket/?location= 192.168.192.2 269µs ↑ 211 B ↓ 444 B
2022-03-27T18:24:19:000 [404 Not Found] s3.GetBucketPolicy minio.mydomain.com/mybucket/?policy= 192.168.192.2 223µs ↑ 211 B ↓ 621 B
2022-03-27T18:24:19:000 [404 Not Found] s3.GetBucketTagging minio.mydomain.com/mybucket/?tagging= 192.168.192.2 284µs ↑ 211 B ↓ 608 B
2022-03-27T18:24:19:000 [200 OK] s3.ListObjectsV2 minio.mydomain.com/mybucket/?delimiter=%2F&encoding-type=url&fetch-owner=true&list-type=2&prefix= 192.168.192.2 516.96ms ↑ 211 B ↓ 1.7 KiB
2022-03-27T18:24:20:000 [200 OK] s3.GetBucketLocation minio.mydomain.com/mybucket/?location= 192.168.192.2 270µs ↑ 211 B ↓ 444 B
2022-03-27T18:24:20:000 [200 OK] s3.ListObjectsV2 minio.mydomain.com/mybucket/?delimiter=%2F&encoding-type=url&fetch-owner=true&list-type=2&prefix= 192.168.192.2 45.061ms
If you want even more verbose output, use
mc admin trace -v myminio
This will log the entire HTTP request:
minio.mydomain.com [REQUEST s3.GetBucketLocation] [2022-03-27T18:25:20:000] [Client IP: 192.168.192.2]
minio.mydomain.com GET /mybucket/?location=
minio.mydomain.com Proto: HTTP/1.1
minio.mydomain.com Host: minio.mydomain.com
minio.mydomain.com X-Forwarded-Host: minio.mydomain.com
minio.mydomain.com X-Amz-Content-Sha256: UNSIGNED-PAYLOAD
minio.mydomain.com X-Amz-Date: 20220327T162520Z
minio.mydomain.com X-Forwarded-Port: 443
minio.mydomain.com X-Forwarded-Proto: https
minio.mydomain.com X-Forwarded-Server: MyVM
minio.mydomain.com Authorization: AWS4-HMAC-SHA256 Credential=GFAHJAODMI71TXAFCXZW/20220327/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=e1edcc3fb0d2130573f7f6633f9f9130810ee0cebcff3359312084c168f2d428
minio.mydomain.com User-Agent: MinIO (linux; amd64) minio-go/v7.0.23
minio.mydomain.com Content-Length: 0
minio.mydomain.com X-Amz-Security-Token: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJHRkFISkFPRE1JNzFUWEFGQ1haVyIsImV4cCI6MTY0ODQwMTQ0OSwicGFyZW50IjoibWluaW9hZG1pbiJ9.ZiuFcseCRRHOmxFs6j6H6nePV6kt9qBnOJESMCIZ-XiPaQrPm5kMlYHGR2zHOfAxf5EUAX3cN8CFbw9BBAQ-2g
minio.mydomain.com Accept-Encoding: gzip
minio.mydomain.com X-Forwarded-For: 192.168.192.2
minio.mydomain.com X-Real-Ip: 192.168.192.2
minio.mydomain.com
minio.mydomain.com [RESPONSE] [2022-03-27T18:25:20:000] [ Duration 2.771ms ↑ 211 B ↓ 444 B ]
minio.mydomain.com 200 OK
minio.mydomain.com X-Amz-Request-Id: 16E04989FD22A42E
minio.mydomain.com X-Xss-Protection: 1; mode=block
minio.mydomain.com Accept-Ranges: bytes
minio.mydomain.com Content-Length: 128
minio.mydomain.com Content-Security-Policy: block-all-mixed-content
minio.mydomain.com Content-Type: application/xml
minio.mydomain.com Vary: Origin,Accept-Encoding
minio.mydomain.com Server: MinIO
minio.mydomain.com Strict-Transport-Security: max-age=31536000; includeSubDomains
minio.mydomain.com X-Content-Type-Options: nosniff
minio.mydomain.com <?xml version="1.0" encoding="UTF-8"?>
<LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/"></LocationConstraint>