Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions hadoop-hdds/docs/content/tools/LogsInOzone.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <host:port> <logger-name> [-protocol http|https]
ozone daemonlog -setlevel <host:port> <logger-name> <level> [-protocol http|https]
```

The `<host:port>` 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:

```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`:
Expand Down
3 changes: 2 additions & 1 deletion hadoop-hdds/docs/content/tools/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -65,4 +66,4 @@ Test tools:

* **freon** - Runs the ozone load generator.

For more information see the following subpages:
For more information see the following subpages: