+ "description": "Get Home Assistant logs from various sources.\n\n**Sources:**\n- \"logbook\" (default): Entity state change history with pagination\n- \"system\": Structured system log entries (errors, warnings) via system_log/list\n- \"error_log\": Raw log text (home-assistant.log on container/pip installs; HA Core's journald stream on Supervisor-backed installs)\n- \"supervisor\": Add-on container logs (requires slug = add-on slug)\n- \"system_service\": HA-Supervisor-managed system service logs (requires\n slug ∈ {supervisor, host, core, dns, audio, cli, multicast, observer})\n- \"logger\": Effective log level per integration via logger/log_info (confirms logger.set_level changes took effect)\n\n**Prefer source='system' for triage.** It returns HA's own deduplicated\nsystem_log entries with counts, first_occurred and full tracebacks; of\nthose only the tracebacks are unrecoverable from the structured\nerror_log summary — they are present in the raw text, so structured=False\ngets them back. Its counts also run\nsince each error first occurred, while structured error_log counts only\nwhat is inside the fetched window (reported as window_start/window_end;\nevery install now reads a capped window). Use error_log\nwith structured=True for entries below system_log's WARNING+ ~50-entry\ncap, or for the per-component rollup.\n\n**Shared params:** limit, search (keyword filter on entries/lines; matches integration domain for source='logger')\n**Order:** order='newest' (default) returns most-recent first; order='oldest' returns chronological-first. Applies to all time-ordered sources (logbook, system, error_log, supervisor, system_service); ignored for source='logger' and for error_log with structured=True. For raw-text sources (error_log, supervisor, system_service) it sets the read direction of the most-recent window.\n**Logbook params:** hours_back, entity_id, end_time, compact (default True — strips attribute dicts to save context)\n**Pagination (logbook + error_log):** offset pages deeper; ignored for the\n other sources. Logbook responses carry has_more plus a\n pagination_hint. On error_log, offset counts raw log lines back from\n the newest entry (journald entries on Supervisor-backed installs),\n both modes read a bounded window per call — so `level`/`search`\n filter and `limit` slice within that window only, and window_lines\n reports the size actually requested — and the response carries\n has_more with a next_offset to pass back while it stays true.\n**System/error_log params:** level (ERROR, WARNING, INFO, DEBUG, CRITICAL)\n**error_log params:** structured, top_n. In structured mode `search`\n matches the message and logger name only, whereas on the raw path it\n matches the whole line; `limit`/`order` do not apply, issues are\n ranked by count, then severity, then recency, and the summary covers\n a fixed deep window rather than the caller's limit.\n**Supervisor params:** slug = add-on slug, e.g. \"core_mosquitto\" (use\n ha_get_app() to list installed slugs)\n**System-service params:** slug = service name. The slug \"supervisor\"\n here means the Supervisor service's own logs, NOT an add-on with\n that name — the source param disambiguates.",
0 commit comments