2nd Log File Created - "home-assistant.log.1"

Does anyone have any idea why a 2nd log file called home-assistant.log.1 is being created in the config folder? I never noticed it before.

Every time I delete it, it comes back. Annoying.

As far as I know it has been introduced with the latest update… and the purpose is most likely to have the log (previous one) available also after restart. Before that the log was always deleted upon restart and if something went wrong you couldn’t figure out, what happened - now you can.

2 Likes

Great. Good to know. Thank you.

Where was that feature announced?

Afaik it was not and I’m also not sure, this is really why it exists - it’s just my interpretation of what’s happening :).
Edit: I was right though - it was announced under “All changes” when releasing 2021.9.0 - here.

2 Likes

I did not see any official statement in any blog post but :

Here is the PR :slight_smile:

The famous All-changes-too-long-list :smiley:

Thanks guys. I’m glad I asked. You were great help.

1 Like

After 18 months of no log-related issues, I suddenly have a 20gb home-assistant.log.1 file.

Anyone else seeing this kind of issue?

I suddenly have the same problem.
At once.
No idea why.

1 Like

Hello did you found any solution? I have the same issue since last updadte , My database is grwing from 1 GB to 60 in 2 days, and this did never happend before…

any help please…
marc

Same here. My home-assistant.log.1 is already 72GB. Any solution to this?

That file gets re-created every time you restart HA. And it only gets the data that is contained in the home-assistant.log file at restart.

if the file that big now then that means the home-assistant.log file was also that big the last time you restarted HA.

So the solution to that big of a file is to look at the file contents and see why you are getting that many info/warning/errors to make your original log file that big in the first place.

2 Likes

Hello,
the size of the home-assistant.log file is determined by the “logger” integration.
It says in the logs that the default logging level is “warning” when nothing is present in the config, but if you put “logger:” and did not specify the level, it becomes debug.
It is a bit hidden but if you scroll down the logger integration documentation page it says so.

Excerpts from the docs:

The log severity level is warning if the logger integration is not enabled in configuration.yaml .

But then below (emphasis is mine):

CONFIGURATION VARIABLES

Looking for your configuration file?

default string (optional, default: debug)

Default log level. See log_level.

So to solve this you need to put default: warning (or less) in the config, as such:

logger:
  default: warning
1 Like