Filtert Zeilen mit typischen Fehlerbegriffen aus einer Text-Logdatei.
Python
from pathlib import Path
for zeile in Path("app.log").read_text(encoding="utf-8", errors="replace").splitlines():
if any(wort in zeile.lower() for wort in ("error", "fatal", "exception")):
print(zeile)
Hinweis: Suchbegriffe an das jeweilige Logformat anpassen.