Skip to content

Handle disabled core log file#52523

Open
adamsteen wants to merge 2 commits into
home-assistant:devfrom
adamsteen:core-170374-managed-log-file
Open

Handle disabled core log file#52523
adamsteen wants to merge 2 commits into
home-assistant:devfrom
adamsteen:core-170374-managed-log-file

Conversation

@adamsteen

@adamsteen adamsteen commented Jun 9, 2026

Copy link
Copy Markdown

Proposed change

Handle Core instances that report no managed log file. This keeps the Logs panel usable when Core is running with HA_DISABLE_LOG_FILE=1, but avoids exposing raw log-file actions that cannot work because there is no Home Assistant-managed log file to serve.

The PR:

  • Shows a warning when Core is not managing a log file.
  • Hides unavailable raw Core log download and full raw log controls.
  • Avoids attempting debug-log download after disabling debug logging when no managed Core log file exists.

Screenshots

After this change, the Logs panel shows a warning alert explaining that raw log view and log download are unavailable because Core is not managing a log file.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to backend pull request: Allow disabling managed log file core#170374

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

To help with the load of incoming pull requests:

Testing

  • yarn prettier --check gallery/src/components/page-description.ts gallery/src/ha-gallery.ts src/data/error_log.ts src/panels/config/integrations/ha-config-integration-page.ts src/panels/config/logs/error-log-card.ts src/panels/config/logs/system-log-card.ts src/translations/en.json
  • yarn eslint gallery/src/components/page-description.ts gallery/src/ha-gallery.ts src/data/error_log.ts src/panels/config/integrations/ha-config-integration-page.ts src/panels/config/logs/error-log-card.ts src/panels/config/logs/system-log-card.ts --max-warnings=0
  • yarn lint:types
  • yarn lint:lit exited successfully with existing repo-wide warnings.
  • Manual: ran Core with HA_DISABLE_LOG_FILE=1 and verified the warning alert and hidden log download controls in the Logs panel.

@github-actions github-actions Bot added the Design Related to Home Assistant design gallery label Jun 9, 2026
@adamsteen adamsteen marked this pull request as ready for review June 9, 2026 21:25
@adamsteen

Copy link
Copy Markdown
Author

@abmantis this is the frontend follow-up for home-assistant/core#170374.

It shows a warning when Core is not managing a log file, hides the unavailable raw/download log actions, and skips the debug-log download path in that state.

@MindFreeze

Copy link
Copy Markdown
Member

Please use the PR template

@adamsteen

Copy link
Copy Markdown
Author

Thanks @MindFreeze, updated the PR description to use the template.

Comment thread src/data/error_log.ts Outdated
Comment on lines +15 to +16
managed_log_file: boolean;
managed_log_file_disabled_reason: ManagedLogFileDisabledReason | null;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where these come from. I don't see them in the core PR

Comment thread src/data/error_log.ts Outdated
Comment on lines +24 to +25
(hass.config as HomeAssistant["config"] & { logging?: LoggingConfig })
.logging;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need this casting

@home-assistant home-assistant Bot marked this pull request as draft June 10, 2026 12:28
@home-assistant

Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@adamsteen adamsteen marked this pull request as ready for review June 10, 2026 12:38
@home-assistant home-assistant Bot requested a review from MindFreeze June 10, 2026 12:38
@adamsteen

Copy link
Copy Markdown
Author

Thanks, addressed both.

The logging config fields are added by the backend PR in home-assistant/core#170374. I had forgotten to push those Core changes before opening this frontend PR, which is why they were not visible there yet. They are pushed now in commit 9de347d.

I also removed the local cast here and added the logging metadata to the local HomeAssistant.config type, so this now reads hass.config.logging directly.

@adamsteen adamsteen force-pushed the core-170374-managed-log-file branch from 1f505e8 to 1bd4662 Compare June 10, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed Design Related to Home Assistant design gallery wait for backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants