From 847d4fe218ff231ecf0a4b2f9af0f06ad24c6c0f Mon Sep 17 00:00:00 2001 From: Pavlo Golub Date: Fri, 28 Mar 2025 16:36:47 +0100 Subject: [PATCH] [*] respect `--log-database-level` when log to `timetable.execution_log` --- internal/pgengine/access.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/pgengine/access.go b/internal/pgengine/access.go index 15373ad6..cc11d54c 100644 --- a/internal/pgengine/access.go +++ b/internal/pgengine/access.go @@ -29,6 +29,14 @@ func (pge *PgEngine) IsAlive() bool { // LogTaskExecution will log current chain element execution status including retcode func (pge *PgEngine) LogTaskExecution(ctx context.Context, task *ChainTask, retCode int, output string) { + switch pge.Logging.LogDBLevel { + case "none": + return + case "error": + if task.IgnoreError || retCode == 0 { + return + } + } _, err := pge.ConfigDb.Exec(ctx, `INSERT INTO timetable.execution_log ( chain_id, task_id, command, kind, last_run, finished, returncode, pid, output, client_name, txid, ignore_error) VALUES ($1, $2, $3, $4, clock_timestamp() - $5 :: interval, clock_timestamp(), $6, $7, NULLIF($8, ''), $9, $10, $11)`,