logging.access_log_format (or logging.access_log_format_preset).
Formatting rules
- Variables are referenced as
$name(example:$status). - If a variable is missing or empty, ONR prints
-at that position. $$renders a literal$.
Configuration
Inonr.yaml:
- Rotation only applies when
access_log_pathis non-empty (file output). - When
access_log_rotate.enabled=true,access_log_pathis required. - Rotation triggers on either day boundary (local time) or size threshold.
- Archive file pattern:
<access_log_path>.YYYYMMDD-HHMMSS.NNNNNNNNN(or.gzwhencompress=true).
max_size_mb: rotate when the next write would exceed this file size.max_backups: keep only the newest N archives.max_age_days: remove archives older than N days;0disables age-based cleanup.compress: gzip archive files after rotation.
- Current behavior is
day-boundary OR size-threshold(not an exclusive mode switch).
Field reference
Request line fields
Identity and routing
Usage and cost
Flat usage extras:
- When
usage_extract custom;usesusage_fact ...with non-legacy detail, ONR also emits flattened usage fields into the access log. - These keys are appended directly as normal log variables and follow a snake_case convention derived from
dimension + attributes + unit. - Legacy scalar usage stays unchanged:
input_tokens,output_tokens,total_tokens,cache_read_tokens,cache_write_tokens. - Typical examples:
$cache_write_ttl_5m_tokens$cache_write_ttl_1h_tokens$server_tool_web_search_calls$image_generate_images$image_edit_images$audio_tts_seconds$audio_stt_seconds$audio_translate_seconds
- For Anthropic non-stream
/v1/messages,cache_write token attr.ttl="5m"andattr.ttl="1h"can therefore appear both as:$cache_write_tokens$cache_write_ttl_5m_tokens$cache_write_ttl_1h_tokens
- The same flattening applies to canonical image/audio/tool facts extracted by ONR or
produced by API-specific OpenAI presets such as
openai_responses,openai_images_generations, oropenai_audio_speech, for example:image.generate imageimage.edit imageaudio.tts secondaudio.stt secondaudio.translate second
- These flattened keys are only present when the corresponding
usage_factmatched or was produced with quantity0from an upstream response that included the field.