Copilot commented on code in PR #8744: URL: https://github.com/apache/ozone/pull/8744#discussion_r2190560236
########## hadoop-hdds/docs/content/tools/LogsInOzone.md: ########## @@ -42,4 +70,39 @@ appender.rolling.strategy.delete.ifLastModified.type=IfLastModified appender.rolling.strategy.delete.ifLastModified.age=30d ``` -For more details, please check [Log4j2 Delete on Rollover](https://logging.apache.org/log4j/2.x/manual/appenders.html#CustomDeleteOnRollover). \ No newline at end of file +For more details, please check [Log4j2 Delete on Rollover](https://logging.apache.org/log4j/2.x/manual/appenders.html#CustomDeleteOnRollover). + +## Debugging + +You can increase the log verbosity for debugging purposes for both services and CLI tools. + +### Enabling Debug Logs for Services + +To enable debug logging for a service, you need to modify its `log4j.properties` file. Change the log level for the desired logger from `INFO` to `DEBUG`. For example, to enable debug logging for the Ozone Manager, you would edit its `log4j.properties` and change the following line: + +``` +rootLogger.level = info +``` + +to: + +``` +rootLogger.level = debug +``` + +After saving the file, the service will start logging more detailed debug information. + +### 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`: + +```bash +export OZONE_ROOT_LOGGER=debug,console Review Comment: [nitpick] Recommend using uppercase for log levels in environment variables (e.g., `export OZONE_ROOT_LOGGER=DEBUG,console`) to match Log4j conventions. ```suggestion export OZONE_ROOT_LOGGER=DEBUG,console ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org