Skip to content

Commit 54d1677

Browse files
nekufaTotktonada
authored andcommitted
log configuration environment options
1 parent 175fbfd commit 54d1677

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Diff for: README.md

+9
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,15 @@ Default is 3600 (every 1 hour).
291291

292292
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.
293293

294+
### `TARANTOOL_LOG_FORMAT`
295+
296+
Optional. There are two possible log formats - 'plain' (default) or 'json' (with more detail and with json labels).
297+
More details can be found in [log module reference](https://www.tarantool.io/en/doc/latest/reference/configuration/#confval-log_format)
298+
299+
### `TARANTOOL_LOG_LEVEL`
300+
301+
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)
302+
294303
# Reporting problems and getting help
295304

296305
You can report problems and request

Diff for: files/tarantool-entrypoint.lua

+4
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ local function wrapper_cfg(override)
182182
file_cfg.TARANTOOL_SLAB_ALLOC_MAXIMAL = os.getenv('TARANTOOL_SLAB_ALLOC_MAXIMAL')
183183
file_cfg.TARANTOOL_PORT = os.getenv('TARANTOOL_PORT')
184184
file_cfg.TARANTOOL_FORCE_RECOVERY = os.getenv('TARANTOOL_FORCE_RECOVERY')
185+
file_cfg.TARANTOOL_LOG_FORMAT = os.getenv('TARANTOOL_LOG_FORMAT')
186+
file_cfg.TARANTOOL_LOG_LEVEL = os.getenv('TARANTOOL_LOG_LEVEL')
185187
file_cfg.TARANTOOL_WAL_MODE = os.getenv('TARANTOOL_WAL_MODE')
186188
file_cfg.TARANTOOL_REPLICATION_SOURCE = os.getenv('TARANTOOL_REPLICATION_SOURCE')
187189
file_cfg.TARANTOOL_REPLICATION = os.getenv('TARANTOOL_REPLICATION')
@@ -236,6 +238,8 @@ local function wrapper_cfg(override)
236238
override.wal_mode
237239

238240
cfg.force_recovery = file_cfg.TARANTOOL_FORCE_RECOVERY == 'true'
241+
cfg.log_format = file_cfg.TARANTOOL_LOG_FORMAT or 'plain'
242+
cfg.log_level = tonumber(file_cfg.TARANTOOL_LOG_LEVEL) or 5
239243

240244
cfg.wal_dir = override.wal_dir or '/var/lib/tarantool'
241245
cfg.vinyl_dir = override.vinyl_dir or '/var/lib/tarantool'

Diff for: files/tarantool_set_config.lua

+2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ local vars = {
8787
TARANTOOL_SLAB_ALLOC_MINIMAL=nop,
8888
TARANTOOL_PORT=nop,
8989
TARANTOOL_FORCE_RECOVERY=nop,
90+
TARANTOOL_LOG_FORMAT=nop,
91+
TARANTOOL_LOG_LEVEL=nop,
9092
TARANTOOL_WAL_MODE=nop,
9193
TARANTOOL_USER_NAME=update_credentials,
9294
TARANTOOL_USER_PASSWORD=update_credentials,

0 commit comments

Comments
 (0)