Logging
Both the AI Service and the AI MCP Server write logs to their respective Tomcat instance log directories. This page explains how logging is configured and how to adjust log output.
Log File Location
By default, log files are written to the logs folder of each Tomcat instance:
- AI Service:
{catalina.base}/logs/ai.log - AI MCP Server:
{catalina.base}/logs/ai-mcp.log
The log file path can be customized using the LOG_FILE_NAME environment variable.
Console Logging
By default, console output is disabled (LOG_THRESHOLD_CONSOLE=OFF). To enable console logging, set LOG_THRESHOLD_CONSOLE to the desired log level (for example, INFO or DEBUG).
Log Level Configuration
Log levels can be configured in application.yml or using environment variables:
Configuration snippet (AI)
logging:
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss.SSS Z} %5p ${PID:- } --- [%t] %logger{0} : %m%n"
file: "%d{yyyy-MM-dd HH:mm:ss.SSS Z} %5p ${PID:- } --- [%t] %logger{0} : %m%n"
file:
name: "${LOG_FILE_NAME:${LOG_DIR}/ai.log}"
threshold:
console: "${LOG_THRESHOLD_CONSOLE:OFF}"
logback:
rollingpolicy:
max-file-size: 10MB
max-history: 7
total-size-cap: 0B
clean-history-on-start: true
Configuration snippet (AI MCP)
logging:
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss.SSS Z} %5p ${PID:- } --- [%t] %logger{0} : %m%n"
file: "%d{yyyy-MM-dd HH:mm:ss.SSS Z} %5p ${PID:- } --- [%t] %logger{0} : %m%n"
file:
name: "${LOG_FILE_NAME:${LOG_DIR}/ai-mcp.log}"
threshold:
console: "${LOG_THRESHOLD_CONSOLE:OFF}"
logback:
rollingpolicy:
max-file-size: 10MB
max-history: 7
total-size-cap: 0B
clean-history-on-start: true
| Environment Variable / Property | Description | Default |
|---|---|---|
LOG_FILE_NAME | Full path to the log file. Overrides the auto-resolved default. Set to empty to disable file logging. | See |
LOG_DIR |
|
|
LOG_THRESHOLD_CONSOLE | Minimum level for console output. Default OFF (file only). Set to a level (e.g., INFO, DEBUG, ALL) to enable console logging. |
|
Rolling Policy
Log files roll when they reach 10MB, or when the calendar date changes (daily), keeping up to 7 archived files. Old archives exceeding max-history are cleaned on application restart.
Multiple rolls can occur within the same day if the log file reaches the size limit, producing indexed files (.0, .1, .2, etc.).
These values can be overridden in application.yml under logging.logback.rollingpolicy.
| Setting | Default Value |
|---|---|
max-file-size | 10 MB |
max-history (days) | 7 |
total-size-cap | 0B |
clean-history-on-start | true |
Rolled Files Format
Archived files follow this naming pattern:
<log-file>.YYYY-MM-DD.N.gz
For example:
ai.log <- active log file
ai.log.2026-03-04.0.gz <- first roll from March 4
ai.log.2026-03-04.1.gz <- second roll from March 4 (size limit hit)
ai.log.2026-03-05.0.gz <- first roll from March 5
Rolled files are automatically gzip-compressed.