Manage Log Files

You can manage your log files by setting up log rotation and adjusting the retention periods.

Log Rotation

The application server is preconfigured to rotate the server.log file regularly, based on settings in the domain configuration file.

For the other log files, such as database.log or audit.log, you may need to set up log rotation to prevent them from consuming excessive disk space. The audit.log file, in particular, may grow quickly because it contains SSH connections to Controller and Event Services hosts that occur every minute. You also need to set up log rotation for an additional log file, <controller_home>/db/data/slow.log. This log contains information about slow MySQL queries.

The tool you use to perform the rotation depends on your operating system. On Linux, you can use the mysql-log-rotate script. The script is included with the Controller database installation at <controller_home>/db/support-files. You need to modify the script for your environment since it is not set up to rotate the database.log file by default. On other systems, you need to create or install a script that performs log rotation and make sure that it get run regularly, for example, by cron or an equivalent task scheduler.

Retention Period

Enterprise Console logs in platfom-admin/logs are automatically archived in a .gz format with a date-time stamp after they grow too large. The size of each archived log is around 300 KB. Only the latest seven files are archived in the logs directory.

If you want to retain the archived logs for longer periods of time, you can configure the settings in the Dropwizard configuration file, PlatformAdminApplication.yml. Under the logging/appenders/type: file section, you need to specify a larger archivedFileCount, as well as maxFileSize. See the Dropwizard Configuration Reference for more information.