WTH - my log is huge! .. my log is gone!

  1. I look into config dir - WTH! My log file is mega huge! Log file has lot of Gigs and it is very hard to copy/open.

  2. Something bad happened in HA. I go to web iface and restart HA. Now it is ok. But i want to find past problem in log. WTH! My log is gone! Log file is deleted after restart.

I think logging needs to be improved. Many of us knows log4j - logging config, rolling, (g)zipping, … I need this in HA!

Duplicate I think? Worded a bit differently but same idea

Or maybe just edit the title to “stop deleting log on restart” and close the other since this has more detail and they have the same # of votes

HASS truncates the log on startup.

Yep, that is wrong IMHO.

Standard logging practice would be to rotate log, or simply append it to the current log.

Kodi starts a new log when it starts and moves the old log to a log.old file. Although still not ideal, it is a reasonable compromise betwen filling your hard drive and theoprwing away valuable info on crashes.

1 Like

@CentralCommand I think it is not duplicate because my post is many wider than linked. I say “do logging professional way”. And lost log on startup is only one of many symptomps of very simple way of logging impl.

I did suggest improving logging in a feature suggestion thread a while ago and got some support. But no eventualisation!

I should have written more… :slight_smile:

It’s not best practice to truncate the log. But, I took a different route and enabled logging to standard out which is then captured by systemd and logged when HASS is run as a service.

Yes, this means double logging, but the amount that it generate currently is not really a concern.

As far as rotation, to keep it simple in HASS, I agree with another suggestion to rotate the log so you have the previous only.

1 Like