novomind
I'm new here

ScheduleEntryControl updatet sich nicht selbständig?

Hallo,

wir haben folgendes Problem. Wir wollen den Publish Auftrag von extern aufrufen und das Logging des Publish in unser eigenes Log schreiben.

Leider funktioniert das nicht. Es wird nur das erste "Paket Logs" geschrieben, das im InputStream enthalten ist.

Derzeit haben wir keine andere Idee, wie man an das fortlaufende Log rankommen könnte.

Das ist der Code:

ScheduleEntryControl executionControl = scheduleEntry.execute();

      Thread.sleep(500);

      InputStream logfile = null;

      BufferedReader reader = null;

      while (executionControl.isRunning()) {

        executionControl.refresh();

        if (logfile == null) {

          logfile = executionControl.getState().getLogfile();

          reader = new BufferedReader(new InputStreamReader(logfile));

        }

        String line = null;

        while ((line = reader.readLine()) != null) {

          logMessage(LogLevel.INFO, line);

        }

        Thread.sleep(200);

      }

  • executionControl.refresh(); hat keine Wirkung
  • Es ist unerheblich, ob die if(logfile == null) Abfrage existiert, oder nicht.

Hat jemand eine Idee? Sieht jemand einen Denkfehler im Code?

Und das ist das Log. Wie man sieht wird das erste "Log Paket" vom Auftrag dupliziert.

[INFO 11:40:36] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:36] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:37] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:37] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:38] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:38] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:38] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:38] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:38] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:38] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:38] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:38] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:38] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:38] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:38] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:38] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:39] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:39] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.905 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting schedule entry 'Publish content' (id=40998) {started by SYSTEM (SYSTEM)}

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.sessionmanagement.SessionManagerImpl): dummy session created (ID=6699762597143973354, user=ScheduleEntry 'Publish content' (id=40998), project 40370)

[INFO 11:40:40] - INFO  19.03.2015 11:40:35.906 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'fill 'clear; generate content and media' start node list' - schedule entry 'Publish content' (id=40998)

[INFO 11:40:40] - INFO  19.03.2015 11:40:36.128 (de.espirit.firstspirit.server.scheduler.ScheduleManagerImpl): starting task 'clear; generate content and media' - schedule entry 'Publish content' (id=40998)

0 Kudos
3 Replies
aVogt
Returning Creator

Hallo Ronny,

versuche mal über executionControl.getState().getTaskResult() zu gehen/iterieren. Da solltest Du die Logs der einzelnen Tasks erhalten.

Habs allerdings nicht getestet (event. muss der Job erst fertig sein).

Grüße

Andreas

0 Kudos

Der Hinweis von Ronny ist korrekt, jede Auftrags-Task hat ihr eigenes Log, da Tasks auch parallel laufen können. Außerdem ist zu beachten, das die Methode "getLogfile()" keinen "live-stream" auf das Log liefert, sondern den aktuellen Inhalt. Daher wird auch bei jedem deiner Schleifen-Durchläufe das Log erneut ausgegeben.

Peter
marza
I'm new here

Hallo Ronny,

benötigst Du noch weitere Hilfe oder haben Dir die Antworten von Andreas und Peter bereits geholfen?

In diesem Fall wäre es super, wenn Du die "richtige Antwort" entsprechend markierst, damit auch andere Community-Teilnehmer diese auf den ersten Blick finden. Solltest Du zwischenzeitlich eine eigene Lösung gefunden haben, wäre es nett, wenn Du diese hier bereitstellst.

Viele Grüße

Marian

0 Kudos