From 1ff29d8fdee2cd13a1378089c4b931cdff6eda4e Mon Sep 17 00:00:00 2001 From: discord9 <55937128+discord9@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:10:57 +0800 Subject: [PATCH] chore: short desc markdown about change log level (#4921) * chore: tiny doc about change log level * chore: per review * chore --- .../how-to/how-to-change-log-level-on-the-fly.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/how-to/how-to-change-log-level-on-the-fly.md diff --git a/docs/how-to/how-to-change-log-level-on-the-fly.md b/docs/how-to/how-to-change-log-level-on-the-fly.md new file mode 100644 index 000000000000..dcbb4f5fd900 --- /dev/null +++ b/docs/how-to/how-to-change-log-level-on-the-fly.md @@ -0,0 +1,16 @@ +# Change Log Level on the Fly + +## HTTP API + +example: +```bash +curl --data "trace;flow=debug" 127.0.0.1:4000/debug/log_level +``` +And database will reply with something like: +```bash +Log Level changed from Some("info") to "trace;flow=debug"% +``` + +The data is a string in the format of `global_level;module1=level1;module2=level2;...` that follow the same rule of `RUST_LOG`. + +The module is the module name of the log, and the level is the log level. The log level can be one of the following: `trace`, `debug`, `info`, `warn`, `error`, `off`(case insensitive). \ No newline at end of file