Skip to content

log4j.xml cannot be reloaded at runtime in the openHAB distribution #1858

@miloit

Description

@miloit

Description

In the openHAB distribution, changes to the log4j.xml file are not applied at runtime. Modifying log levels, loggers, or appenders has no effect until the openHAB service is fully restarted.

This behavior is unexpected, as Log4j configurations are typically reloadable at runtime (via file watching or a reload mechanism).

Expected Behavior

Changes to log4j.xml should be applied:

automatically (e.g. via file watcher / reload interval), or

via an explicit reload command (e.g. log:reload or equivalent),

without requiring a full restart of openHAB.

Actual Behavior

Changes to log4j.xml are ignored while openHAB is running

Active log levels and logger configuration remain unchanged

Only a full restart of openHAB causes the updated configuration to be loaded

Affected Environment

openHAB distribution (not Karaf-only setups)

Observed on Linux systems

Reproducible regardless of bindings or add-ons

Steps to Reproduce

  1. Start openHAB
  2. Modify log4j.xml (e.g. change a logger’s log level)
  3. Save the file

Observe the logs
→ No change takes effect

Additional Information / References

This behavior is related to the long-standing issue:

openhab/openhab-core#4529

The latest comments indicate that:

log4.xml is no longer actively monitored or reloaded in the distribution

Logging configuration appears to be partially overridden or statically initialized

There is effectively no supported runtime reload mechanism for log4j.xml

Impact

Live debugging is unnecessarily difficult

Restarting openHAB is required in production environments

Behavior contradicts user expectations and parts of the documentation

Suggestion

Either:

support runtime reloading of log4j.xml,
or

clearly document that log4j.xml changes are not supported at runtime
and describe the recommended alternative (e.g. Karaf log:set commands only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions