Logger
The logger
integration lets you define the level of logging activities in Home
Assistant.
To enable the logger
integration in your installation,
add the following to your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file:
The log severity level is warning
if the logger integration is not enabled in configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more].
To log all messages and ignore events lower than critical for specified integrations:
To ignore all messages lower than critical and log event for specified integrations:
The log entries are in the form
timestamp log-level thread [namespace] message
where namespace is the <component_namespace> currently logging.
Configuration Variables
Default log level. See log_level.
List of integrations and their log level.
Logger namespace of the integration. See log_level.
Regular Expression logging filters.
Logger namespace of the integration and a list of Regular Expressions. See Log Filters.
In the example, do note the difference between ‘glances_api’ and ‘homeassistant.components.glances’ namespaces, both of which are at root. They are logged by different APIs.
If you want to know the namespaces in your own environment then check your log files on startup.
You will see INFO log messages from homeassistant.loader stating loaded <component> from <namespace>
.
Those are the namespaces available for you to set a log level
against.
Log levels
Possible log severity levels, listed in order from most severe to least severe, are:
- critical
- fatal
- error
- warning
- warn
- info
- debug
- notset
Log filters
Service-specific Regular Expression filters for logs. A message is omitted if it matches the Regular Expression.
An example configuration might look like this:
Actions
Action set_default_level
You can alter the default log level (for integrations without a specified log
level) using the logger.set_default_level
action.
An example call might look like this:
Action set_level
You can alter log level for one or several integrations using the logger.set_level
action.
It accepts the same format as logs
in the configuration.
An example call might look like this:
Viewing logs
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
.
You can use the example below, when logged in through the SSH add-on:
On Docker you can use your host command line directly - follow the logs dynamically with:
To see other options use --help
instead, or simply leave with no options to display the entire log.