replication-manager icon indicating copy to clipboard operation
replication-manager copied to clipboard

Improve compliance log management

Open svaroqui opened this issue 5 months ago • 0 comments

The idea is to have non hard coded logs that today work only for opensvc and only without tag nosplitpath in jobs

ERROLOG=$DATADIR/.system/logs/error.log SLOWLOG=$DATADIR/.system/logs/slow-query.log

Should be replace with something like

ERROLOG=%%ENV:SVC_CONF_ENV_ERROR_LOG%% SLOWLOG=%%ENV:SVC_CONF_ENV_SLOW_LOG%% CMD_EXTRACT_SLOW_LOG= %%ENV:SVC_CONF_ENV_CMD_EXTRACT_SLOW_LOG%% CMD_EXTRACT_ERROR_LOG= %%ENV:SVC_CONF_CMD_EXTRACT_ERROR_LOG%%

depending on the tags used the configurator can call new function GetDbErrrorLog() , GetDbExtractCommandErrrorLog() GetDbSlowLog() ,GetDbExtractCommandSlowLog() GetDbSlowLog that will output according the tags if not provisioned or could send the value of show variables log option if already provision

Note 1 if log_output | TABLE slow query logs are send to a table we empty such CMD_EXTRACT_SLOW_LOG because it is directly get from the table in replication-manager code

Note 2 if systemd onpremise the we can set CMD_EXTRACT_ERROR_LOG to the correct command

Note 3 we should try to memorize last fetch line offset in file and no destroy original client file

Note 4 if log_output SYSBENCH CMD_EXTRACT_ERROR_LOG should be set to something reading syslog with filter for mariadb or mysql

Log rotation should be manage in other scheduler optional case , that will use log rotate on linux so we assume that if we track fetch line position and that it out of scope we will restart counter at 1

svaroqui avatar Aug 27 '24 14:08 svaroqui