600MB home-assistant.log - How to limit logfile size?

The home assistant log file seems to be growing and growing.

Is there a mechanism to prevent this?
Something like max file size, log file rotation, keep last x days, etc…

checkout the logger: component. You can specify the log level for specific things or set it log-wide to something like error so anything below error (info, warning, etc) won’t get logged.

Yes I saw the log levels and while I may be logging too much atm the problem remains.

Eventually the log will take up more and more space if you have a long enough uptime.

Use:

command line option for that: hass --log-rotate-days 5

command line option

2 Likes

Thank you, that is interesting,
I guess I’ll have to find out how HA is behaving in the dockerized version.

Dumb question but I am a real Linux noob. I am using Autostart for HA. Do I just run the command at the command line once, or do I need to add it to my Autostart file?

I think better to include command in Autostart file.

1 Like