Log Management
DataCaster has a number of log files. The following separate log files are generated by DataCaster, some of which depend on the configuration options.
- Transaction Logs Each database contains transaction logs in the log directory within the database directory. These transaction logs are critical to the operation of the database, and should not be deleted when the database is operational. It is possible to delete older transaction log files, but we suggest using the procedures outlined below rather than trying to delete them youself.
- DataCaster Logs These error, infomation and audit logs are stored in the logs directory (unless configured otherwise), and can be accessed as plain files, or through the WebAdmin console.
- Tomcat logs On Linux, the Tomcat log is in the Tomcat/logs directory, i.e. catalina,.out, which contains information on Tomcat reported errors.
Please see the configuration reference for information on managing these logs.
Transaction Log Cleanup
The database logs are extremely important to the stability and reliability of a database. But they can grow very large very soon and there comes a time when the logs have to be cleaned up to release disk space. This can be done by either manually deleting the files in the log directory or by making it
automatic by setting a few template parameters.
Template Parameters:
db.log_enable_cleanup is a boolean which can be used to enable or disable the automatic log cleanup feature by setting it to true or false respectively. By default, log cleanup is disabled.
The following two parameters are valid only when the db.log_enable_cleanup is set to true. Values can be set to any one of them or both of them. When both are set, then they are analysed to determine which will result in the
smaller database size and the log is cleaned up to meet that setting’s requirements.
db.log_max_files is used to specify the maximum number of log files the user wants to retain. To disable this parameter set it to -1
eg: enabled: db.log_max_files=100
disabled: db.log_max_files=-1
db.log_age denotes the maximum age of the log events. Log files older than this age are deleted. The age is denoted using this format DD:HH:mm i.e in days, hours and minutes (days can be more than 2 digits). To disable this parameter, set it to a null string.
eg: enabled: db.log_age=7:00:00
db.log_age=100:00:00
disabled: db.log_age=
These parameters have to be set in the
database templates ie default.tpl or the .tpl file for the specific database.
When are the template parameters read?
Every time the database is opened or every time the log grows by 10 MB (when a new log file is created) the template parameters are loaded and read. Cleanup is done if necessary.
The log files are always deleted starting from the
oldest to the
newest.
It is recommended that a good number of log files are retained depending on the various needs of the database.
Irrespective of what the parameters suggest, a
minimum of 25 log files is retained always.
Note:
At the time when the log files are being accessed by another thread, like when dump or table migration is in progress, the log cleanup is temporarily disabled.(not yet done for table migration)