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.
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!
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.
@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.
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.