Skip to main content

Access Usage Logs

1. Console Access

1

Log in to Console

Visit Laozhang API Console and log in
2

Open Usage Logs

Usage Log Management InterfaceClick “Usage Logs” in the left menu
3

View Log Details

In the log list you can view:
  • Request Time: When the request occurred
  • Model Used: Which model was called
  • Token Count: Number of tokens used
  • Cost: This request’s cost
  • Request Status: Success/failure status
  • Request Parameters: Detailed request information

2. API Query

Get usage logs via API:

Log Information Details

Basic Information

Usage Statistics

Request Details

Error Information

When request fails, additional information is recorded:

Time Range Filtering

Model Filtering

Status Filtering

Usage Analysis

Cost Analysis

Analyze usage costs:

Usage Trend Analysis

Peak Time Analysis

Error Rate Analysis

Export Logs

Export to CSV

Export to JSON

Generate Report

Automated Monitoring

Set Up Alert System

Regular Report Generation

Common Questions

Log Retention Policy:
  • Standard users: 30 days
  • Professional users: 90 days
  • Enterprise users: 1 year
Extended Retention:
  • Can purchase extended log retention service
  • Support custom retention period
  • Support historical log export
Filtering by API Key:In console:
  1. Select “Filter by API Key” on log page
  2. Choose the API Key you need to view
  3. View filtered results
Via API:
Log Deletion Policy:
  • Logs cannot be manually deleted (for audit and billing purposes)
  • Logs are automatically deleted after retention period expires
  • Can contact support for special deletion requests
Privacy Protection:
  • Logs do not contain sensitive information (like prompts)
  • Only statistical information and metadata are recorded
  • Can enable “Privacy Mode” to reduce log details
Timestamp Format:
  • All timestamps use UTC time
  • Console can display local time
  • API returns UTC timestamps
Convert to Local Time:
Batch Export:
  1. Use Pagination
  2. Export in Chunks
    • Export by month to avoid single file being too large
    • Use compressed format to reduce storage space
    • Consider using database storage instead of files

Best Practices

1. Regular Monitoring

Establish regular monitoring mechanisms:

2. Alert Configuration

Set reasonable alert thresholds:
  • Cost alert: Set based on daily average + 2 standard deviations
  • Error rate alert: Over 10% trigger alert
  • Token alert: Abnormally high single request tokens

3. Data Backup

Regularly backup important logs:
  • Export and save monthly logs
  • Use version control to manage reports
  • Consider using cloud storage for backup

4. Privacy Protection

Protect sensitive information:
  • Don’t log detailed request content
  • Enable log encryption
  • Control log access permissions
  • Regularly clean up old logs