Configuring log rotation
Available in Informer 2025.2.9 and later.
Informer has built-in log rotation that manages log file size and retention automatically, keeping the server healthy and Elasticsearch uninterrupted. It rotates logs by size and/or date, lets you cap how many archives are kept, and can compress them.
Configuration
Log rotation is off by default. To enable it, set logDestination to file in the Informer config and adjust logFile:
"logDestination": "file",
"logFile": {
"logDirectory": "logs",
"maxSize": "20m",
"maxFiles": "14d",
"zippedArchive": true,
"filename": "informer5-%DATE%.log",
"datePattern": "YYYY-MM-DD",
"instanceIdVar": "NODE_APP_INSTANCE"
}
When logDestination is stdout (the default), logs go to standard output and all logFile settings are ignored.
Windows installer
When the Windows installer runs Informer directly on Windows, log rotation is on from the start. Whenever config.json has no logDestination (a first install, or an upgrade of a server that never set one), the installer writes logDestination: "file". It never overwrites a value that is already there, so setting stdout keeps rotation off across upgrades.
The rotated logs are in the logs folder of the install's data directory (C:\Entrinsik\Informer5 Server\data\logs by default), beside the <role>.log files the service writes. Those <role>.log files still collect startup and crash output, and the service does not rotate them. Each Informer role (informer-api, informer-query, informer-schedules) gets one file per worker, for example informer-api-2026-10-08-0.log and informer-api-2026-10-08-1.log for two API workers.
The settings in the table below apply, with three exceptions:
filenameis set per role by the service, so a value inconfig.jsonis ignored.instanceIdVarmust stayNODE_APP_INSTANCE, the only instance ID the service provides. Setting it toINSTANCE_IDputs every worker of a role in the same file.dataDiris set to the install's data directory by the service, so a value inconfig.jsonis ignored.logDirectorystill applies inside it.
Parameters
| Parameter | Default | What it does |
|---|---|---|
logDestination | stdout | Set to file to enable log rotation; stdout sends logs to standard output and ignores the settings below. |
dataDir | data | The folder logDirectory is resolved in, relative to the directory Informer runs from or absolute. A top-level setting beside logDestination, not inside logFile. Available in 2026.1.4 and later. |
logDirectory | logs | Subdirectory for log files, relative to dataDir. |
maxSize | 20m | Size at which a log file rotates. Use a unit suffix (20m, 500k, 2g) directly after the number, or raw bytes as a number (20971520). |
maxFiles | 14d | How many archives to keep. Use a days suffix (14d, 30d) or a raw count (10 keeps the last 10 files). If unset, nothing is removed. |
zippedArchive | true | Whether to gzip rotated logs to .gz. |
filename | informer-%DATE%.log | Filename template. Must include %DATE%. The instance ID is inserted after the date, 0 when the instanceIdVar variable is unset or empty (for example informer-2025-02-19-0.log). |
datePattern | YYYY-MM-DD | Date format for %DATE%, which also sets how often logs rotate: YYYY-MM-DD daily, YYYY-MM-DD-HH hourly, YYYY-MM monthly. |
instanceIdVar | NODE_APP_INSTANCE | The environment variable holding the worker's instance ID in cluster mode, so each worker logs to its own file. PM2 and the Windows installer's service both set NODE_APP_INSTANCE; match this to your PM2 instance_var if you customized it. Valid values: NODE_APP_INSTANCE or INSTANCE_ID. |