@@ -11,15 +11,16 @@ logo: home-assistant.png
11
11
ha_category : " Utility"
12
12
---
13
13
14
- The logger component lets you define the level of logging activities in Home Assistant.
14
+ The ` logger ` component lets you define the level of logging activities in Home Assistant.
15
15
16
- To enable the logger in your installation, add the following to your ` configuration.yaml ` file:
16
+ To enable the ` logger ` component in your installation, add the following to your ` configuration.yaml ` file:
17
17
18
- To have a full log and log everything only this entry is needed (without any qualifier):
19
18
``` yaml
19
+ # Example configuration.yaml entry
20
20
logger :
21
21
` ` `
22
- To log all messages and ignore events lower than critical for specified components.
22
+
23
+ To log all messages and ignore events lower than critical for specified components:
23
24
24
25
` ` ` yaml
25
26
# Example configuration.yaml entry
@@ -30,7 +31,7 @@ logger:
30
31
homeassistant.components.camera : critical
31
32
` ` `
32
33
33
- To ignore all messages lower than critical and log event for specified components.
34
+ To ignore all messages lower than critical and log event for specified components:
34
35
35
36
` ` ` yaml
36
37
# Example configuration.yaml entry
@@ -43,7 +44,25 @@ logger:
43
44
homeassistant.components.camera : critical
44
45
` ` `
45
46
46
- Possible log severities are:
47
+ {% configuration %}
48
+ default:
49
+ description: Default log level.
50
+ required: false
51
+ type: '[log_level](#log-levels)'
52
+ default: debug
53
+ logs:
54
+ description: List of components and their log level.
55
+ required: false
56
+ type: map
57
+ keys:
58
+ '<component_namespace>':
59
+ description: Logger namespace of the component.
60
+ type: '[log_level](#log-levels)'
61
+ {% endconfiguration %}
62
+
63
+ ### {% linkable_title Log Levels %}
64
+
65
+ Possible log severity levels are:
47
66
48
67
- critical
49
68
- fatal
@@ -53,11 +72,26 @@ Possible log severities are:
53
72
- info
54
73
- debug
55
74
- notset
56
-
75
+
76
+ ## {% linkable_title Services %}
77
+
78
+ ### {% linkable_title Service ` set_default_level` %}
79
+
80
+ You can alter the default log level (for components without a specified log
81
+ level) using the service `logger.set_default_level`.
82
+
83
+ An example call might look like this :
84
+
85
+ ` ` ` yaml
86
+ service: logger.set_default_level
87
+ data:
88
+ level: info
89
+ ` ` `
90
+
57
91
# ## {% linkable_title Service `set_level` %}
58
92
59
93
You can alter log level for one or several components using the service
60
- ` ` logger.set_level`` . It accepts the same format as `` logs` ` in the configuration.
94
+ ` logger.set_level` . It accepts the same format as `logs` in the configuration.
61
95
62
96
An example call might look like this :
63
97
@@ -68,15 +102,18 @@ data:
68
102
homeassistant.components.media_player.yamaha: debug
69
103
` ` `
70
104
71
- The log information are stored in the [configuration directory](/docs/configuration/) as `home-assistant.log` and you can read it with the command-line tool `cat` or follow it dynamically with `tail -f`.
105
+ The log information are stored in the [configuration directory](/docs/configuration/)
106
+ as `home-assistant.log` and you can read it with the command-line tool `cat` or
107
+ follow it dynamically with `tail -f`.
72
108
73
109
If you are a Hassbian user you can use the example below :
74
110
75
111
` ` ` bash
76
112
$ tail -f /home/homeassistant/.homeassistant/home-assistant.log
77
113
` ` `
78
114
79
- If you are a Hass.io user you can use the example below, whenlogged in through the ssh addon :
115
+ If you are a Hass.io user, you can use the example below, when logged in through
116
+ the [SSH add-on](/addons/ssh/) :
80
117
81
118
` ` ` bash
82
119
$ tail -f /config/home-assistant.log
0 commit comments