What is the difference between log, logger, logbook

Can someone explain the difference for log vs logger vs logbook?

Thanks.

Ocean

In simple words:
Logbook - located in left panel, shows history of entities states and automation triggers
Logger - located in developer tools > logs, shows errors of home assistant components
System Log - located in supervisor > system, show errors of supervisor, home assistant and hassio addons

Read more:



But…

most of the time when people talk about “look in your HA log” they are talking about looking at the “home-assistant.log” file located in your config directory.

Hmm… so is “home-assistant.log” yet another log? It doesn’t match any of the other three in terms of content, although it appears to share SOME lines, especially with that from Logger.

it is the official home assistant log. I don’t know it for an absolute fact but I’m fairly certain that the log in the developers tools page is derived from that one but home-assistant.log contains more info.

If I have any problems I only ever look at the home-assistant.log file.

However, it also now seems that you can access the entire home-assistant.log contents from the “logs” screen by clicking the button all the way at the bottom of the page. I never noticed that until now.

I’m pretty sure the “logbook” on the left side panel is derived from the recorder/history component.

1 Like

That seems consistent with what I’ve seen too. The home-assistant.log is my go to as well for me currently, but that might change as I learn more. I’ve spent a fair amount of time in the OZW log to troubleshoot some things.

I know this is an old, but still very valid question. I had the same question and what I found was that all three “logs” (system_log, logbook and logger) are actually integrations with their own configurations and settings. Some of the questions I still have are:

  • what are the specific set of events that are routed towards each one of them?
  • where are each one of those logs stored? file, database, etc?

Is anyone out there has some of those answers I would really appreciate it.
Thanks,
R

The logger integration is just used to set system_log level and filters. They are both dealing with the system log. I’m sure there is a reason why they are separate integrations, but I don’t know what that reason it is. All home assistant core events are recorded in this log (if they aren’t filtered out).

The system log is located at /config/home-assistant.log This log clears each time you restart. The system log from the previous session is located at /config/home-assistant.log.1 It can be accessed through the UI on the Configuration Panel → Logs. The top part is a summary of warn and greater severity log events. The entire log can be viewed here by clicking the button below the summary.

There are additional logs for the supervisor, host, DNS etc. available on the supervisor panel and also a zwave log if you have it installed available from the zwave integration panel. Each addon also has it’s own internal log that can be accessed on the the addon’s configuration page.

Logbook is a completely different “user friendly” event list that only displays events you configure and that are recorded in the home assistant database. It is meant to be viewed in the UI using the logbook panel.

Thanks a lot @jazzyisj for spelling that out for me, really helped me understand how it was broken down.

1 Like