7 Replies Latest reply on Oct 30, 2019 12:33 PM by Andrew Dinn

    traceOpen() created a file, but trace() and traceln() couldn't write message into the file

    Yusuke SATO Newbie

      I am using byteman to trace call stack in JGit on Windows 10.

      I wrote a byteman rule to trace start of a method like this:

      RULE CheckoutCommand Start
      CLASS org.eclipse.jgit.api.CheckoutCommand
      METHOD call
      AT ENTRY
      IF true
      DO
        traceOpen("log","D:/tmp/byteman_" + java.net.InetAddress.getLocalHost().getHostName() + "_" + java.time.ZonedDateTime.now().format(java.time.format.DateTimeFormatter.ISO_LOCAL_DATE) + ".log");
        trace("log", java.time.ZonedDateTime.now().format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS")) + "\t" +$0.getRepository().getDirectory().getParentFile().getName() + "\t");
        traceln("log", "[Start][checkout] Start checkout branch: " + $0.name);
        traceClose("log");
      ENDRULE

       

      This rule was loaded successfully (When I run Eclipse from ".\eclipsec.exe -debug -consoleLog", a message "Installed rule using default helper : CheckoutCommand Start" is shown in the console), and a file like "D:/tmp/byteman_MyComputer_2019-10-30.log" was created.

      But the trace message specified in trace() and traceln() was not written into that file.

       

      I can write these message into console with debug() method, so I think the message itself has no problem.

       

      Additionaly, the rule can wrote the message into file successfully, at another computer. Both machines run Windows 10 and use JDK 1.8.0.

       

      How can I investigate the cause of this problem?