ccproxy.plugins.access_log.writer¶
ccproxy.plugins.access_log.writer
¶
AccessLogWriter
¶
Simple async file writer for access logs.
Features: - Async file I/O for performance - Optional buffering to reduce I/O operations - Thread-safe with asyncio.Lock - Auto-creates parent directories
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_file
|
str
|
Path to the log file |
required |
buffer_size
|
int
|
Number of entries to buffer before writing |
100
|
flush_interval
|
float
|
Time in seconds between automatic flushes |
1.0
|
Source code in ccproxy/plugins/access_log/writer.py
write
async
¶
Write a line to the log file.
Lines are buffered and written in batches for performance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line
|
str
|
The formatted log line to write |
required |
Source code in ccproxy/plugins/access_log/writer.py
close
async
¶
Close the writer and flush any remaining data.