From 54d16777bf34530ac895852d4979de8b7ec678c6 Mon Sep 17 00:00:00 2001 From: dmitry krokhin Date: Mon, 30 Aug 2021 17:36:36 +0300 Subject: [PATCH] log configuration environment options --- README.md | 9 +++++++++ files/tarantool-entrypoint.lua | 4 ++++ files/tarantool_set_config.lua | 2 ++ 3 files changed, 15 insertions(+) diff --git a/README.md b/README.md index b2bbdfd..42a477a 100644 --- a/README.md +++ b/README.md @@ -291,6 +291,15 @@ Default is 3600 (every 1 hour). Optional. When set to "true" Tarantool tries to continue if there is an error while reading a snapshot file or a write-ahead log file. Skips invalid records, reads as much data as possible, print a warning in console and start the database. +### `TARANTOOL_LOG_FORMAT` + +Optional. There are two possible log formats - 'plain' (default) or 'json' (with more detail and with json labels). +More details can be found in [log module reference](https://www.tarantool.io/en/doc/latest/reference/configuration/#confval-log_format) + +### `TARANTOOL_LOG_LEVEL` + +Optional. Default value is 5 (that means INFO). More details can be found in [logging log levels configuration](https://www.tarantool.io/en/doc/latest/reference/configuration/#cfg-logging-log-level) + # Reporting problems and getting help You can report problems and request diff --git a/files/tarantool-entrypoint.lua b/files/tarantool-entrypoint.lua index db69dfc..ba6f907 100755 --- a/files/tarantool-entrypoint.lua +++ b/files/tarantool-entrypoint.lua @@ -182,6 +182,8 @@ local function wrapper_cfg(override) file_cfg.TARANTOOL_SLAB_ALLOC_MAXIMAL = os.getenv('TARANTOOL_SLAB_ALLOC_MAXIMAL') file_cfg.TARANTOOL_PORT = os.getenv('TARANTOOL_PORT') file_cfg.TARANTOOL_FORCE_RECOVERY = os.getenv('TARANTOOL_FORCE_RECOVERY') + file_cfg.TARANTOOL_LOG_FORMAT = os.getenv('TARANTOOL_LOG_FORMAT') + file_cfg.TARANTOOL_LOG_LEVEL = os.getenv('TARANTOOL_LOG_LEVEL') file_cfg.TARANTOOL_WAL_MODE = os.getenv('TARANTOOL_WAL_MODE') file_cfg.TARANTOOL_REPLICATION_SOURCE = os.getenv('TARANTOOL_REPLICATION_SOURCE') file_cfg.TARANTOOL_REPLICATION = os.getenv('TARANTOOL_REPLICATION') @@ -236,6 +238,8 @@ local function wrapper_cfg(override) override.wal_mode cfg.force_recovery = file_cfg.TARANTOOL_FORCE_RECOVERY == 'true' + cfg.log_format = file_cfg.TARANTOOL_LOG_FORMAT or 'plain' + cfg.log_level = tonumber(file_cfg.TARANTOOL_LOG_LEVEL) or 5 cfg.wal_dir = override.wal_dir or '/var/lib/tarantool' cfg.vinyl_dir = override.vinyl_dir or '/var/lib/tarantool' diff --git a/files/tarantool_set_config.lua b/files/tarantool_set_config.lua index 17ef143..95d3a25 100755 --- a/files/tarantool_set_config.lua +++ b/files/tarantool_set_config.lua @@ -87,6 +87,8 @@ local vars = { TARANTOOL_SLAB_ALLOC_MINIMAL=nop, TARANTOOL_PORT=nop, TARANTOOL_FORCE_RECOVERY=nop, + TARANTOOL_LOG_FORMAT=nop, + TARANTOOL_LOG_LEVEL=nop, TARANTOOL_WAL_MODE=nop, TARANTOOL_USER_NAME=update_credentials, TARANTOOL_USER_PASSWORD=update_credentials,