Skip to main content
srai1
Gold ⭐️
May 5, 2017

Changing Log Location for HUE

  • October 5, 2026 at 9:24 AM
  • 0 replies
  • 1948 views
  • Translate All

GOAL

To change the default log location for HUE from /var/log/hue to elsewhere.

Steps

Default HUE service writes the log files to /var/log/hue directory. This is somehow enforced in the code which states this

The ``log_dir`` will replace the %LOG_DIR% in log.conf. If not specified, we look for the DESTKOP_LOG_DIR environment variable, and then default to the DEFAULT_LOG_DIR.

However, trying to set either variables i.e. DESKTOP_LOG_DIR and DEFAULT_LOG_DIR don't seem to work.

We can however change the %LOG_DIR% with an absolute path within /etc/hue/conf/log.conf. Here is an output of the log.conf replaced with absolute path for the log directory.

#args=('%LOG_DIR%/access.log', 'a', 1000000, 3)
args=('/opt/log/hue/access.log', 'a', 1000000, 3)
--
#args=('%LOG_DIR%/error.log', 'a', 1000000, 3)
args=('/opt/log/hue/error.log', 'a', 1000000, 3)
--
#args=('%LOG_DIR%/%PROC_NAME%.log', 'a', 1000000, 3)
args=('/opt/log/hue/%PROC_NAME%.log', 'a', 1000000, 3)
--
#args=('%LOG_DIR%/shell_output.log', 'a', 1000000, 3)
args=('/opt/log/hue/shell_output.log', 'a', 1000000, 3)
--
#args=('%LOG_DIR%/shell_input.log', 'a', 1000000, 3)
args=('/opt/log/hue/shell_input.log', 'a', 1000000, 3)

NOTE: Do ensure that the new log directory exists and has hue as user and group.

Post the changes, a restart of hue service should be good enough to route the new logs in the new location.