OSS provides two ways to track object access and operations: real-time log query and logging. Both capture details about each request, including the requester's IP address and the request type.
Compare methods
| Real-time log query | Logging | |
|---|---|---|
| How it works | Integrates OSS with Log Service to query access logs | Generates access log files and writes them to a bucket |
| Log delivery | Continuously available for querying | Hourly |
| Use when | You need to search logs, run statistics, audit access, track exception events, or troubleshoot issues | You need periodic log files stored in a bucket for offline processing |
Real-time log query
Real-time log query integrates OSS with Log Service. Use it to query and collect statistics for OSS access logs, audit access, track exception events, and troubleshoot issues.
For setup and usage details, see Real-time log query.
Logging
The logging feature generates access log files on an hourly basis, following a fixed naming convention, and writes them to a bucket you specify. Each log file records details about requests made to your OSS resources, including the requester's IP address and the request type.
For setup and usage details, see Logging.