Automatic Log Rotation in X100
X100 offers the option to automatically rotate the log file if its size surpasses a specified limit (for example, 1GB or 2GB) or if a specified time interval has passed (e.g. every 30 days). It also includes the option of automatically compressing the rotated log file to .gz format. For more information, see
X100 Configuration Parameters.
When you specify a fixed time interval for Automatic Log Rotation, the log rotation will not always happen precisely after the specified time, but only the next time data is written to the log file.
The log file size check is performed at an interval of 15 minutes to check and compare the log file's size to the size limit specified in the configuration, but only when data is written to the log file.
Note: If vw_log_rotation_use_auto_compression is set, the old log file will also be compressed while calling the vwlog_rotate manually. For more information, see Rotating the X100 Error Log.
Persistent Change
In order to make one of the options persistent (i.e. remains valid even if the database is shut down), it has to be specified under the [server] section in vectorwise.conf.
Example of Usage in vectorwise.conf:
[server]
vwlog_rotation_use_size_threshold=true
vwlog_rotation_size_threshold=1G
vwlog_rotation_use_time_interval=true
vwlog_rotation_time_interval=PT12H vwlog_rotation_use_auto_compression=true
If a non-valid value is provided to one of the options, then the last valid value will remain active (e.g., setting vwlog_rotation_use_size_threshold='xyz' will not have any effect on the option). Non-valid means either bogus data or values that are not between the lower and the upper bound for the size, respectively time-thresholds. This is applicable for invalid changes during runtime.
Changes during Runtime
To modify the new options during runtime, you must use the CALL X100 syntax.
CALL X100(SETCONF 'server, parameter_name, ''parameter_value'' [,GLOBAL]')
When the GLOBAL parameter is used, the setting remains in effect until the server is shutdown and for the duration of the session when omitted.
Usage Example:
CALL X100(SETCONF 'server, vwlog_rotation_use_size_threshold, ''true'', GLOBAL')
CALL X100(SETCONF 'server, vwlog_rotation_size_threshold, ''1G'', GLOBAL')
CALL X100(SETCONF 'server, vwlog_rotation_use_time_interval, ''true'', GLOBAL')
CALL X100(SETCONF 'server, vwlog_rotation_time_interval, ''PD12H'', GLOBAL')
CALL X100(SETCONF 'server, vwlog_rotation_use_auto_compression, ''true'', GLOBAL')
Changing Error Log Configuration Settings Dynamically
Error logging configuration can be changed dynamically, for example, if you want to increase the logging level while debugging a process. The VWLOG_RELOAD system call loads a specific X100 error log configuration file, whose rules are used for all subsequent log events. Restarting Vector is not necessary.
For example, the following statement enables Vector to immediately start using the specified log configuration file on Windows:
CALL X100(VWLOG_RELOAD '''C:\\Program Files\\Actian\\VectorVW\\ingres\\files\\vwlog.conf''');
For more information, see VWLOG_RELOAD in the SQL Language Guide.
Last modified date: 12/19/2024