<< Click to Display Table of Contents >> Manual > Server Creation Guide > Action Edition > Action Reference > Logger Action (Logging Only) > Log data maintenance (automatic deletion) |
Maintenance of log data
Settings related to logging data maintenance (automatic deletion) can be made from the properties of the logger action. If you check "Perform database maintenance" on the "Log details" tab, log data records will be automatically deleted at a set period of time. This period can be specified in days.
Log data will be deleted at the following times:
▪When the date changes
When the system is continuously online, such as during production operation, log data maintenance is performed at the time the date changes.
▪When you go online
When switching from offline to online, it will determine whether maintenance is required and perform log maintenance if necessary. Even if you switch between online and offline several times in a day, maintenance will only be performed once a day.
▪When any timing is specified in the event parameters
If you specify MAINTENANCE as a parameter when registering an event execution action, logging will not be performed and only maintenance will be called.
CSV maintenance process
When logging to CSV files, the maintenance process depends on how the file name is extended.
item |
Operation |
none |
If the files are not separated by date, when maintenance is performed, it searches the log file for records, deletes the records that are to be deleted, creates temporary files, and then deletes the original files and replaces them with the temporary files once it has confirmed that all the records have been saved successfully. At this time, if the log file to be maintained is open by an external application, the maintenance work will be interrupted because the file cannot be deleted and will be retried at the next maintenance schedule. |
Add date and time to file name |
If you separate files by date, the maintenance process will delete the files for the target date. Since it only deletes files, the process is fast. In addition, the decision as to whether or not to delete is made by extracting the date from the file name according to the following date format.
"%Y%m%d%H%M%S" "%Y%m%d%H%M" "%Y%m%d%H" "%Y%m%d" "%Y%m" "%Y"
If none of the above applies, the same processing as in the "Append tag value to file name" case below will be performed. |
Append the tag value to the file name |
It searches for all files that exist in the specified file path and deletes any files whose file names contain all the characters specified in the "\path\filename.extension" format and whose "file modification date and time" (OS attribute) is older than the specified period. This is a fast process as it only involves deleting files. |
Please note that if the log file is open using an external application, the maintenance process may be interrupted and carried over until the next maintenance period. |
If the folder in which the log files to be maintained are stored contains files other than log files, please pay attention to the file names of those files. If the file name or creation date matches the deletion conditions, unexpected files may be deleted. Therefore, we recommend that you create a folder for storing log files as a log-only folder and configure it separately from system and application folders. |
Database (ODBC) maintenance process
When maintenance is performed, records that are subject to deletion are deleted by issuing a SQL command.
In addition, in the case of Oracle, the date format is'yyyy-mm-dd'Please set it so that it can be used.