Need Help? We are right here!
Thanks for your Enquiry. Our team will soon reach out to you.
If you don't hear from us within 24 hours, please feel free to send a follow-up email to info@xecurify.com
Search Results:
×Without log rotation, miniOrange IAM log files grow continuously and can fill the disk, causing service disruption. This guide explains how log rotation is configured for both the IAM Server and miniOrange Services, where environment variables must be set, and how to verify and troubleshoot the setup.
miniOrange IAM On-Premise has two distinct logging systems:
catalina-moas.out log. Variables: LOG_FILE_SIZE, LOG_RETENTION_DAYS, LOG_RETENTION_SIZE.MO_LOGS_PATH, MO_MAX_FILE_SIZE, MO_LOGS_PERSIST_DAYS, ROOT_LOG_LEVEL, MO_LOGS_LEVEL.All variables for both systems are set in the same environment file. The IAM Server and Services sections below cover each system in detail.
Log rotation is supported in IAM version 5.2.1 and later. For all other services, log rotation support is available starting from IAM version 4.8.
All log-related environment variables are set in the following file, which is created automatically during miniOrange IAM installation:
/etc/mo-idp-server.env
setenv.sh) will not be picked up reliably across all components.sudo nano /etc/mo-idp-server.env
The IAM Server (Tomcat) uses log4j2 for log management. The configuration is defined in log4j2.xml inside the deployment.
Note: Log rotation for the IAM Server is available from miniOrange IAM On-Premise v5.2.1 and above.
$CATALINA_HOME/logs/catalina-moas.out
$CATALINA_HOME/logs/catalina-moas.<MM-dd-yyyy>.<index>.log
catalina-moas.06-06-2026.1.log (first rotation on 6 June 2026)| Variable | Default | Format | What It Controls |
|---|---|---|---|
LOG_FILE_SIZE |
20MB | e.g. 10MB, 50MB | Maximum size of catalina-moas.out before a rotation is triggered. When this size is reached, the file is immediately rolled regardless of the time of day. |
LOG_RETENTION_DAYS |
7d | e.g. 3d, 14d, 30d | Rolled files whose last-modified timestamp is older than this value are deleted during the next rollover. Increase to keep logs longer; decrease to save disk space. |
LOG_RETENTION_SIZE |
2GB | e.g. 500MB, 5GB | If the combined size of all rolled .log files exceeds this value, the oldest rolled files are deleted one by one during the next rollover until the total drops below the limit. The active catalina-moas.out is never counted or deleted. |
A rotation triggers when either of these conditions is met, whichever occurs first:
catalina-moas.out reaches the size set by LOG_FILE_SIZE.OR logic:
catalina-moas.out rotates more than 7 times within a single day (because LOG_FILE_SIZE is set very small relative to daily log volume), log4j2 will not create an 8th file for that day.DefaultRolloverStrategy used in the bundled log4j2.xml and is not configurable without modifying the XML.LOG_FILE_SIZE is large enough that daily log output does not cause more than 7 rotations. For example, if the server produces roughly 700 MB of logs per day, set LOG_FILE_SIZE to at least 100MB./etc/mo-idp-server.env:# IAM Server (Tomcat) log rotation
LOG_FILE_SIZE=20MB
LOG_RETENTION_DAYS=7d
LOG_RETENTION_SIZE=2GB
All miniOrange services share a single log4j2 configuration. Each service writes its own log into a subdirectory under MO_LOGS_PATH.
$MO_LOGS_PATH/<service-name>/<service-name>.out
$MO_LOGS_PATH/<service-name>/<service-name>.<MM-dd-yyyy>-<index>.log
| Variable | Default | Format | What It Controls |
|---|---|---|---|
MO_LOGS_PATH |
(required) | Absolute directory path | Base directory under which each service creates its own log subdirectory. If this variable is not set or is empty, file logging is disabled for all services — logs go to console only. |
MO_MAX_FILE_SIZE |
100 MB | e.g. 50 MB, 200 MB (space required) | Maximum size of each service active log file before rotation triggers. The same limit applies to all services. Default is 100 MB — note this is larger than the IAM Server default of 20MB. |
MO_LOGS_PERSIST_DAYS |
30 | Integer (count of files) | Number of rolled files to retain per service. This is a count-based limit, not time-based. log4j2 keeps this many rolled files and deletes the oldest when a new one is created. Default is 30 files per service. |
ROOT_LOG_LEVEL |
WARN | TRACE, DEBUG, INFO, WARN, ERROR, OFF | Log verbosity for the root logger (all packages not otherwise configured). Lower levels produce significantly more log data. Recommended: WARN for production. |
MO_LOGS_LEVEL |
INFO | TRACE, DEBUG, INFO, WARN, ERROR, OFF | Log verbosity specifically for the com.miniorange package. Set to DEBUG when troubleshooting miniOrange-specific issues. Recommended: INFO for production. |
File logging is disabled without MO_LOGS_PATH
MO_LOGS_PATH is not set in /etc/mo-idp-server.env, the EnvironmentArbiter in the service log4j2 configuration disables the RollingFile appender entirely. All service log output goes to console (stdout) only — no log files are written and no rotation occurs.MO_LOGS_PATH to an absolute path on a partition with sufficient free space.Setting ROOT_LOG_LEVEL or MO_LOGS_LEVEL to DEBUG or TRACE produces significantly more log output, which causes log files to grow faster and rotation to trigger more frequently. In production, use WARN for ROOT_LOG_LEVEL and INFO for MO_LOGS_LEVEL unless actively debugging an issue. Return to these levels after debugging is complete.
Add or update these lines in /etc/mo-idp-server.env:
# Service log configuration
MO_MAX_FILE_SIZE=100 MB
MO_LOGS_PERSIST_DAYS=30
ROOT_LOG_LEVEL=WARN
MO_LOGS_LEVEL=INFO
'100 MB' not '100MB'. This matches the format in the service log4j2 configuration. Using no space may not be read correctly.LOG_FILE_SIZE), no space is needed: '20MB'.ls -lh $CATALINA_HOME/logs/catalina-moas.out
tail -20 $CATALINA_HOME/logs/catalina-moas.out
ls -lh $CATALINA_HOME/logs/catalina-moas.*.log
grep -E 'LOG_FILE_SIZE|LOG_RETENTION' /etc/mo-idp-server.env
du -sh $CATALINA_HOME/logs/
To trigger a test rotation without waiting for midnight or heavy traffic: temporarily set LOG_FILE_SIZE=1MB in /etc/mo-idp-server.env, restart the service, perform one login attempt or any API call, then check for a new rolled file. Restore the original value and restart again.
MO_LOGS_PATH is set:grep MO_LOGS_PATH /etc/mo-idp-server.env
ls -lh $MO_LOGS_PATH/<service-name>/
ls -lh $MO_LOGS_PATH/<service-name>/<service-name>.out
ls -lh $MO_LOGS_PATH/<service-name>/<service-name>.*.log
| Symptom / Mistake | Cause and Fix |
|---|---|
| IAM Server logs never rotate | Variables are not being read. Ensure LOG_FILE_SIZE and LOG_RETENTION_DAYS are set in /etc/mo-idp-server.env — not in a shell session or Tomcat's setenv.sh. Verify the miniOrange service was fully restarted after editing the file. |
| Service log files are not created at all | MO_LOGS_PATH is not set or is empty. Without this variable, file logging is disabled for all services. Set MO_LOGS_PATH to a valid absolute directory path in /etc/mo-idp-server.env and restart. |
| IAM Server rotates almost immediately after startup | LOG_FILE_SIZE is missing the unit suffix. Example: LOG_FILE_SIZE=20 (no unit) is interpreted as 20 bytes, causing near-continuous rotation. Always include the unit: LOG_FILE_SIZE=20MB. |
MO_MAX_FILE_SIZE not respected for services |
The service log4j2 configuration requires a space between the number and unit. Use MO_MAX_FILE_SIZE=100 MB (with space), not 100MB. Without the space the value may not parse correctly. |
| Old rolled files are not being deleted | Deletion only runs during a rollover event, not on a schedule. If no rotation has occurred recently (the active file is small and midnight has not passed), stale files remain. Trigger a rotation manually to force a cleanup pass. |
Active log file (catalina-moas.out) disappears |
Do not delete the active log file while Tomcat is running. log4j2 holds an open file handle; deleting the file while the process is running causes logging to silently stop. Restart the miniOrange service to recreate the file. |
| Disk still full after configuring retention limits | Cleanup only runs at the next rollover. If the disk is already full, rotation cannot trigger. Manually remove old rolled files using the emergency cleanup commands below, then configure proper retention values. |
| IAM Server stops creating rolled files mid-day | The maximum is 7 rolled files per calendar day (see Known Limitation above). If LOG_FILE_SIZE is set too small for the daily log volume, this limit is reached. Increase LOG_FILE_SIZE so that no more than 7 rotations occur per day. |
| Log level change has no effect | ROOT_LOG_LEVEL and MO_LOGS_LEVEL are read at service startup. Changes to /etc/mo-idp-server.env require a full service restart to take effect. A SIGHUP or reload is not sufficient. |
Caution — do not delete the active log file.
catalina-moas.out while Tomcat is running. log4j2 holds an open file handle..log files — files that include a date in their name.
# Total log directory size
du -sh $CATALINA_HOME/logs/
# List IAM rolled files, largest first
ls -lhS $CATALINA_HOME/logs/catalina-moas.*.log
# Delete IAM rolled files older than 3 days
find $CATALINA_HOME/logs/ -name 'catalina-moas.*.log' -mtime +3 -delete
# Delete service rolled files older than 3 days
find $MO_LOGS_PATH/ -name '*.log' -mtime +3 -delete
# Confirm disk space recovered
df -h $CATALINA_HOME/logs/
/etc/mo-idp-server.env with appropriate size and retention values, then restart the miniOrange IAM service.| Variable | Default | Applies To | Purpose |
|---|---|---|---|
LOG_FILE_SIZE |
20MB | IAM Server | Rotate active log when it reaches this size |
LOG_RETENTION_DAYS |
7d | IAM Server | Delete rolled files older than this age |
LOG_RETENTION_SIZE |
2GB | IAM Server | Delete oldest rolled files if combined total exceeds this |
MO_LOGS_PATH |
(required) | Services | Base directory for service logs (required for file logging) |
MO_MAX_FILE_SIZE |
100 MB | Services | Rotate per-service active log at this size (include space: 100 MB) |
MO_LOGS_PERSIST_DAYS |
30 | Services | Number of rolled files to keep per service (count, not days) |
ROOT_LOG_LEVEL |
WARN | Services | Log verbosity for all packages (root logger) |
MO_LOGS_LEVEL |
INFO | Services | Log verbosity for com.miniorange packages only |
| Component | Active Log File | Rolled File Pattern |
|---|---|---|
| IAM Server | $CATALINA_HOME/logs/catalina-moas.out |
catalina-moas.MM-dd-yyyy.N.log |
| Services | $MO_LOGS_PATH/<svc>/<svc>.out |
<svc>.MM-dd-yyyy-N.log |
/etc/mo-idp-server.env
Created automatically during miniOrange IAM installation. Edit this file to configure all log variables. Always restart the miniOrange IAM service after changes.