I downloaded the log from my ha root folder but it only contained the last few hours
I need a log from yesterday though
did it clear logs cause I hard rebooted?
I downloaded the log from my ha root folder but it only contained the last few hours
I need a log from yesterday though
did it clear logs cause I hard rebooted?
the homeassistant.log file gets reset after every HA restart.
But after a restart those logs get transferred to another file called homeassistant.log.1
so you will look there for any logs from the time between the last 2 restarts of HA. If you restart HA in quick succession you wonât have much info in the homeassistant.log.1 file.
ty
I just noticed another issue: recent events arenât included in the log in the first place
itâs just the ones from a narrow time window yesterday, I think right after my reboot
I think that might depend on what you are trying to look for and/or what your log level settings are.
you mean those settings in the config.yaml?
logger:
logs:
homeassistant.config: notset
system_log:
max_entries: 40
How should I change them to be able to see the events from yesterday onwards?
it depends on what you want to see.
if you want to see everything for everything then add:
logger:
default: debug
logs:
homeassistant.config: notset
that will log pretty much everything that happens in the system (that is log-able) but the log will get very large very fast.
If you only want to see the logs from a specific integration then you can set the log level for that integration. Or if you are getting errors that arenât being recorded then you can set the log level to a more reasonable level (for example âerrorâ) instead of debug.
but you keep mentioning that you want to see âeventsâ. I donât think âeventsâ (as itâs defined in HA) will be recorded in the log. Events are things that get set on the event bus and are seen by the system to trigger things (or get triggered by other events).
what âeventsâ do you want to see?
if you really do want to see âeventsâ then you will need to set up the âevent viewerâ in the dev tools page to listen for the desired events.
Isnât log level âdebugâ more detailed than whatâs set up by default and would therefore fill the log up faster?
I think I need to know how to actually make the log larger because it seems like the amount of entries it has is limited.
Can I perhaps do that via:
system_log:
max_entries: 2000
I thought that I couldnât because itâs set to 40 right now and the log obviously shows more than 40 entries. So there needs to be another parameter to change that, right?
I donât know if I want to see âeventsâ. All I know is thereâs something happening that causes my system to crash and I need to know what it is.
browse to your config folder and read the homeassistant.log file there.
Youâre confusing the limitations of the download button in the UI with the actual size of the file. There is no log size restriction on actual file, the download button only gives you the last X lines.
I canât right now for some reason. Iâve waited 10 minutes for the log to load and the page has already auto-refreshed. That didnât happen before. And upon trying to download it I get a â502: Bad Gatewayâ-error
Install samba share or use an addon like vscode to view the file. I have no idea what youâre using right now, but itâs probably not the best tool for the job. Or download the file using SCP via SSH. You have many options.
That isnât the log that HA writes to for the stuff happening in HA.
as mentioned above the log you need to be looking at to see HA specific related stuff is the homeassistant.log file found in your configuration directory which is the same directory where configuration.yaml is also found.
It is simply a text file that you read with any text viewer. You canât access that file from within the HA UI unless you have some way via the UI to access the actual text based yaml config files.
there is no limit to that log file size either. it keeps getting bigger until you restart HA itself. At that point it gets re-initialized to empty and then starts the content over again.
But then the contents of that file gets transferred to another file called homeassistant.log.1 found in the same directory.
If itâs small number of lines and you are seeing it on a âpageâ that gets ârefreshedâ then you are definitely not looking in the right place.
Now all of that being said you may actually want to look at the actual system log file created by the OS since you are trying to see why HA is crashing. Iâm honestly not sure where that file resides on your OS since I assume you use HA OS. Normally it would be found under the /var/log directory in the root of your OS file system.
I do it via file editor
how do I enable samba? I had it working in a previous installation but canât find the tutorial on how to do it anymore. SSHing via putty just fails
also, dont you need like a different kind of ssh to download this file? like some developer level modification on HA where the site of itsâ tutorial says âyou will not get support for thisâ? because thats what people in another thread where I read abt SSHing for logs weeks ago recommended
It is simply a text file that you read with any text viewer. You canât access that file from within the HA UI unless you have some way via the UI to access the actual text based yaml config files.
I have File Editor with which I can (theoretically) see and download home-assistant.log so I think Iâm seeing the right log. Maybe I didnât see all of it the first time because of some bugâŚ
I use HA OS
How do I access the root of my OS file system? This pops up upon googling how to access /var/log. I suppose thatâs what Iâm looking for?
(btw @petro the HAOS (alternative way) section of it was what I was referring to earlier. Will I get any support in this forum upon attempting this?)
You donât need root accesss, you just need to view your log file for home assistant. Youâre being your own worse enemy here. Download and install the vscode addon and view the homeassistant log through that. That will not have any file size viewing restrictions incase your log is huge. Otherwise install the samba share addon which will let you use another computer to do the exact same thing with some other text editor.
viewing/downloading the log via Studio Code Server doesnât work. It gets stuck on loading just as File Editor but this time my entire HA crashed.
will try out SAMBA now
If you want view it in vscode then youâre having larger issues. The file is either too large or something else is going on. Delete your previous logs and the current log. Restart and see if you can watch the log size with a file size watcher integration.
which integration can do that?
dang I tried adding âFile Sizeâ by clicking on the âadd to HAâ button on itsâ page but it just gave me the error âConfig flow could not be loaded: [object Object]â
It doesnât show up in the list of integrations either.
I remembered I can see the file size via File Editor
its 27.500KiB (about 28mb) and the size of .log.1 is 73.000KiB (abt 75mb)
the rpis memory is abt 1GB so considering how less the RAM seems to be used according to my screenshot earlier, the numbers dont add up
to be fair there has to be something to your theory considering that shortly after i reboot the log file is openable but after a while it isnt anymore
1gb of ram is not enough to run HA. Especially if you have a bunch of addons running.