Home_assistant.log

Hi There, I’m running home assistant;

Home Assistant 2023.2.4
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230202.0 - latest

Recently I’ve been having issues with home_assistant.log file filling up and using an excessive amount of disk space. Has anyone had a similar experience or know of a solution?

Thanks for helping out.

Unless you’ve changed the default logging configuration, you log should only have errors and warnings in it and these typically don’t take much space, unless you have errors that are repeating. What is in the log?

indeed that’s what I see warnings and errors. And I haven’t changed anything in the logging settings. Looking at the individual logs it looks to me like the culprit “home assistant core” earlier I had about 12000 warning for my volume media player. It is switched off when not in use cause it runs on a different RPI.

Logger: homeassistant.helpers.entity
Source: components/volumio/media_player.py:85 
First occurred: 9:46:46 PM (240 occurrences) 
Last logged: 10:26:37 PM

Update for media_player.denon_audio fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1064, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1049, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 960, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 500, in sock_connect
    return await fut
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 535, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('xxx.xxx.xxx.xxx', 3000)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pyvolumio/volumio.py", line 49, in _get_volumio_msg
    response = await self._session.get(url, params=params)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host xxx.xxx.xxx.xxx:3000 ssl:default [Connect call failed ('xxx.xxx.xxx.xxx', 3000)]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 548, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/components/volumio/media_player.py", line 85, in async_update
    self._state = await self._volumio.get_state()
  File "/usr/local/lib/python3.10/site-packages/pyvolumio/volumio.py", line 75, in get_state
    response = await self._get_volumio_msg("getState")
  File "/usr/local/lib/python3.10/site-packages/pyvolumio/volumio.py", line 58, in _get_volumio_msg
    raise CannotConnectError() from error
pyvolumio.volumio.CannotConnectError

Can I simply delete the home_assistant.log file?

Disable logging for your media player.

However even 12,000 entries in a text file should bot be hat large. What is the size of your log file?

I know how to set the log level to different levels but what is the setting for disabled?

I don’t think I’ve ever seen an integration report a critical error. So that should do it.

2 Likes

I know the amount of text a log file produces could not equate to the amount of data it’s recording. And it really hasn’t been an issue in the past. I think it started 2023.2.0 but not sure.

When I started this topic the file size was 85,9 GB now it’s around 87. A week ago the lig file had grin so large my 256 SSD ran out of space and HA started warning me about it.

I too would like to know how to disable logging. I have some lights that are controlled by led controllers which also physically switch off. The state unavailable then serves as a trigger for an automation. This leads to a warning of the controller not being available. While irritating it too does not constitute such a large data increase. But it would be nice to disable the logging for it.

You can: https://www.home-assistant.io/integrations/logger/#log-filters

Thanks!
For now I’ve, as you suggested, switched the logger to critical and that seems to have worked. I.o.w the log file doesn’t increase in size. It’s a bit of an eerie feeling. Not to see what’s going on behind the scenes but ok. It beats getting a message that your 256g ssd is full :wink:

I plan to set up diff loglevels for the different components as some log issues are a nuisance when for example entities are not available as mentioned in the post 2 days ago.