Skip to main content

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:

  • filename is set per role by the service, so a value in config.json is ignored.
  • instanceIdVar must stay NODE_APP_INSTANCE, the only instance ID the service provides. Setting it to INSTANCE_ID puts every worker of a role in the same file.
  • dataDir is set to the install's data directory by the service, so a value in config.json is ignored. logDirectory still applies inside it.

Parameters​

ParameterDefaultWhat it does
logDestinationstdoutSet to file to enable log rotation; stdout sends logs to standard output and ignores the settings below.
dataDirdataThe 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.
logDirectorylogsSubdirectory for log files, relative to dataDir.
maxSize20mSize at which a log file rotates. Use a unit suffix (20m, 500k, 2g) directly after the number, or raw bytes as a number (20971520).
maxFiles14dHow 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.
zippedArchivetrueWhether to gzip rotated logs to .gz.
filenameinformer-%DATE%.logFilename 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).
datePatternYYYY-MM-DDDate format for %DATE%, which also sets how often logs rotate: YYYY-MM-DD daily, YYYY-MM-DD-HH hourly, YYYY-MM monthly.
instanceIdVarNODE_APP_INSTANCEThe 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.