Logging#
The server writes structured log lines in the format:
<timestamp> [<LEVEL>] pid=<pid> <logger>: <message>
The process ID in each line lets you distinguish workers in a multi-worker deployment.
Daily file rotation#
LOG_UTC (default true) controls both the timestamp timezone and the date boundary used for the daily file rollover. Set LOG_UTC=false to use local time for both.
The log directory (LOG_DIR, default ./logs) is created on startup if it does not exist. The server fails fast if the directory cannot be created or written to.
Log files are named:
<LOG_DIR>/<LOG_FILE_PREFIX>.<YYYYMMDD>.log
for example ./logs/onetick-mcp.20260701.log. A new file is opened when the date rolls over; restarts on the same day append to the existing file, and files are never renamed or deleted.
uvicorn integration#
When file logging is enabled, uvicorn.error (startup, shutdown, and error messages) is also routed to the file. uvicorn.access (per-request lines) is deliberately left on stdout only.
Configuration variables#
For the full list of logging environment variables, see Logging variables in the configuration reference.