Skip to content

Conversation

@MartinRinas
Copy link
Contributor

@MartinRinas MartinRinas commented Jan 4, 2025

Adds in-memory log handler and attaches them to selected loggers. In-memory log handlers are flushed when 10s loop starts, all messages of that run are kept and written to *.latest.log. A *.latest-warning.log is generated in addition if any error or warning has been logged.

Scope of this PR:

  • main.log
  • soc.log

Other logs like mqtt, chargelog or data_migration don't seem to benefit from this change.

@MartinRinas MartinRinas changed the title add in-memory log handler to capture latest log cycle and keep last with warnings or errors Keep log messages from last full run and last run with error or warnings Jan 4, 2025
@MartinRinas
Copy link
Contributor Author

@LKuemmel ich hab' Zeit gefunden meinen eigenen Wunsch zum Loghandling umzusetzen, bin immer wieder erstaunt was sich mit GitHub Copilot umsetzen lässt wenn man eine grobe Idee hat, aber das Detailwissen zu den Möglichkeiten fehlt.

Es ist mir nicht gelungen die Handler für internal_chargepoint und smarthomehandler zu erkennen, bzw. herauszufinden ob & wo diese zyklisch gestartet werden. Sofern hier auch zyklisch gearbeitet wird kann ich dort noch die in-memory Logger initialisieren und speichern.

@MartinRinas MartinRinas marked this pull request as ready for review January 5, 2025 15:25
@MartinRinas
Copy link
Contributor Author

Mit dem PR sind grundsätzlich auch weitere Szenarien denkbar, z.b. Logs nach dem letzten Ladestart/Stopp oder anderen Events welche ggf. weiter in der Vergangenheit liegen und sich daher nur schwer im Nachhinein analysieren lassen sofern das Problem nicht unmittelbar reproduzierbar ist.

@MartinRinas
Copy link
Contributor Author

@LKuemmel kann ich Dich hier auch um ein Review bitten? Ist aus meiner Sicht inzwischen fertig und hat sich bei mir lokal bewährt.

@MartinRinas
Copy link
Contributor Author

@LKuemmel Die Änderungen um die letzten drei Durchläufe aufzubewahren sind jetzt integriert. Den Merge-Konflikt beseitige ich auch gleich noch.

@LKuemmel LKuemmel merged commit e201dec into openWB:master May 7, 2025
1 check passed
@MartinRinas MartinRinas deleted the feature-EnhanceLogging branch May 7, 2025 20:40
LKuemmel pushed a commit to LKuemmel/core that referenced this pull request Aug 12, 2025
…ngs (openWB#2118)

* add in-memory log handler to capture latest log cycle and keep last with warnings or errors

* specifcy log to be cleared and saved, add soc.log handling

* skip writing to disk if there are no messages

* keep last three logs, remove duplicate urllib logging

* add warning/error
LKuemmel added a commit to LKuemmel/core that referenced this pull request Aug 12, 2025
…ings (openWB#2118)

    * add in-memory log handler to capture latest log cycle and keep last with warnings or errors

    * specifcy log to be cleared and saved, add soc.log handling

    * skip writing to disk if there are no messages

    * keep last three logs, remove duplicate urllib logging

    * add warning/error
LKuemmel added a commit to LKuemmel/core that referenced this pull request Aug 12, 2025
…ings (openWB#2118)

    * add in-memory log handler to capture latest log cycle and keep last with warnings or errors

    * specifcy log to be cleared and saved, add soc.log handling

    * skip writing to disk if there are no messages

    * keep last three logs, remove duplicate urllib logging

    * add warning/error
LKuemmel added a commit that referenced this pull request Aug 13, 2025
…ings (#2118) (#2657)

* add in-memory log handler to capture latest log cycle and keep last with warnings or errors

    * specifcy log to be cleared and saved, add soc.log handling

    * skip writing to disk if there are no messages

    * keep last three logs, remove duplicate urllib logging

    * add warning/error
LKuemmel added a commit that referenced this pull request Oct 14, 2025
LKuemmel added a commit that referenced this pull request Oct 14, 2025
LKuemmel added a commit that referenced this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants