From 6e63f200993c4f878f9ab9b7806240295a7aff10 Mon Sep 17 00:00:00 2001 From: f64116045 Date: Tue, 28 Jul 2026 08:40:18 +0800 Subject: [PATCH 1/2] HDDS-15954. Document ozone daemonlog command --- hadoop-hdds/docs/content/tools/LogsInOzone.md | 31 +++++++++++++++++++ hadoop-hdds/docs/content/tools/_index.md | 3 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/hadoop-hdds/docs/content/tools/LogsInOzone.md b/hadoop-hdds/docs/content/tools/LogsInOzone.md index 73613d766c4e..22ce2de623e6 100644 --- a/hadoop-hdds/docs/content/tools/LogsInOzone.md +++ b/hadoop-hdds/docs/content/tools/LogsInOzone.md @@ -93,6 +93,37 @@ rootLogger.level = debug After saving the file and restarting the service, the service will start logging more detailed debug information. +### Changing Service Log Levels at Runtime + +Use `ozone daemonlog` to inspect or change the log level of a running Ozone daemon without restarting it. The command talks to the daemon's HTTP endpoint and is useful when you need temporary debug logging while troubleshooting a live service. + +```bash +ozone daemonlog -getlevel [-protocol http|https] +ozone daemonlog -setlevel [-protocol http|https] +``` + +The `` value is the daemon HTTP address. For example, the default HTTP ports are `9874` for Ozone Manager, `9876` for Storage Container Manager, `9882` for Datanode, `9878` for S3 Gateway, and `9888` for Recon. + +The following example checks the effective log level for the SCM event queue logger: + +```bash +ozone daemonlog -getlevel scm.example.com:9876 org.apache.hadoop.hdds.server.events.EventQueue +``` + +To increase the same logger to `DEBUG`: + +```bash +ozone daemonlog -setlevel scm.example.com:9876 org.apache.hadoop.hdds.server.events.EventQueue DEBUG +``` + +After collecting the required debug information, reset the logger to its previous level: + +```bash +ozone daemonlog -setlevel scm.example.com:9876 org.apache.hadoop.hdds.server.events.EventQueue INFO +``` + +The change applies to the running daemon process. To make a log level change persistent across restarts, update the service's `log4j.properties` file instead. + ### Enabling Debug Logs for CLI Tools To enable debug logging for Ozone CLI tools (e.g., `ozone sh volume create`), you can set the `OZONE_ROOT_LOGGER` environment variable to `debug`: diff --git a/hadoop-hdds/docs/content/tools/_index.md b/hadoop-hdds/docs/content/tools/_index.md index 3a8bf08e826f..256db030395f 100644 --- a/hadoop-hdds/docs/content/tools/_index.md +++ b/hadoop-hdds/docs/content/tools/_index.md @@ -53,6 +53,7 @@ Admin commands: * **admin** - Collects admin and developer related commands related to the ozone components. * **insight** - Generic tool to display filtered log, metrics or configs to help debuging. See [the observability]({{< ref "feature/Observability.md" >}}) page for more information. + * **daemonlog** - Gets or sets the runtime log level of Ozone daemon loggers through their HTTP endpoints. * **classpath** - Prints the class path needed to get the hadoop jar and the required libraries. * **dtutil** - Operations related to delegation tokens @@ -65,4 +66,4 @@ Test tools: * **freon** - Runs the ozone load generator. - For more information see the following subpages: \ No newline at end of file + For more information see the following subpages: From f77dd723500f946300b8ee33960464fa5f491c0e Mon Sep 17 00:00:00 2001 From: f64116045 Date: Tue, 28 Jul 2026 13:09:46 +0800 Subject: [PATCH 2/2] HDDS-15954. Use S3 Gateway web admin port in daemonlog docs --- hadoop-hdds/docs/content/tools/LogsInOzone.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdds/docs/content/tools/LogsInOzone.md b/hadoop-hdds/docs/content/tools/LogsInOzone.md index 22ce2de623e6..65a1a3374e66 100644 --- a/hadoop-hdds/docs/content/tools/LogsInOzone.md +++ b/hadoop-hdds/docs/content/tools/LogsInOzone.md @@ -102,7 +102,7 @@ ozone daemonlog -getlevel [-protocol http|https] ozone daemonlog -setlevel [-protocol http|https] ``` -The `` value is the daemon HTTP address. For example, the default HTTP ports are `9874` for Ozone Manager, `9876` for Storage Container Manager, `9882` for Datanode, `9878` for S3 Gateway, and `9888` for Recon. +The `` value is the daemon HTTP address. For example, the default HTTP ports are `9874` for Ozone Manager, `9876` for Storage Container Manager, `9882` for Datanode, `19878` for the S3 Gateway web admin server, and `9888` for Recon. The following example checks the effective log level for the SCM event queue logger: