refactor: make init_global_logging() clean and add log_format (#4657)

refactor: refine the code logic of init_global_logging and add json output format
This commit is contained in:
zyy17
2024-09-04 11:04:51 +08:00
committed by GitHub
parent 8ca35a4a1a
commit 8453df1392
10 changed files with 191 additions and 94 deletions

View File

@@ -589,7 +589,7 @@ fork_dictionary_bytes = "1GiB"
## The logging options.
[logging]
## The directory to store the log files.
## The directory to store the log files. If set to empty, logs will not be written to files.
dir = "/tmp/greptimedb/logs"
## The log level. Can be `info`/`debug`/`warn`/`error`.
@@ -605,6 +605,9 @@ otlp_endpoint = "http://localhost:4317"
## Whether to append logs to stdout.
append_stdout = true
## The log format. Can be `text`/`json`.
log_format = "text"
## The percentage of tracing will be sampled and exported.
## Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1.
## ratio > 1 are treated as 1. Fractions < 0 are treated as 0