Logger


The logger component lets you define the level of logging activities in Home Assistant.

To enable the logger component in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
logger:

To log all messages and ignore events lower than critical for specified components:

# Example configuration.yaml entry
logger:
  default: info
  logs:
    homeassistant.components.device_tracker: critical
    homeassistant.components.camera: critical

To ignore all messages lower than critical and log event for specified components:

# Example configuration.yaml entry
logger:
  default: critical
  logs:
    homeassistant.components: info
    homeassistant.components.rfxtrx: debug
    homeassistant.components.device_tracker: critical
    homeassistant.components.camera: critical

Configuration Variables

default

(log_level)(Optional)Default log level.

Default value: debug

logs

(map)(Optional)List of components and their log level.

<component_namespace>

(log_level)Logger namespace of the component.

Log Levels

Possible log severity levels, listed in order from most severe to least severe, are:

  • critical
  • fatal
  • error
  • warning
  • warn
  • info
  • debug
  • notset

Services

Service set_default_level

You can alter the default log level (for components without a specified log level) using the service logger.set_default_level.

An example call might look like this:

service: logger.set_default_level
data:
  level: info

Service set_level

You can alter log level for one or several components using the service logger.set_level. It accepts the same format as logs in the configuration.

An example call might look like this:

service: logger.set_level
data:
  homeassistant.components: warning
  homeassistant.components.media_player.yamaha: debug

The log information are stored in the configuration directory as home-assistant.log and you can read it with the command-line tool cat or follow it dynamically with tail -f.

If you are a Hassbian user you can use the example below:

$ tail -f /home/homeassistant/.homeassistant/home-assistant.log

If you are a Hass.io user, you can use the example below, when logged in through the SSH add-on:

$ tail -f /config/home-assistant.log