SynchronizingSelfLog { public static void infoWithTraceId(String log) { doLog(log, INFO_PREFIX + "[" + TracerUtils.getTraceId() + "]"); }  static void error(String log, Throwable e); static void errorWithTraceId(String log, Throwable e); static void error(String log); static void errorWithTraceId(String log, String traceId); static void errorWithTraceId(String log); static void warn(String log); static void info(String log); static void infoWithTraceId(String log); static void flush();  }
@Test public void infoWithTraceId() throws IOException { SynchronizingSelfLog.infoWithTraceId("test info with tracerId"); SynchronizingSelfLog.flush(); File log = customFileLog("sync.log"); List<String> logs = FileUtils.readLines(log); assertTrue(logs.toString(), logs.get(0).contains("[INFO]")); assertTrue(logs.toString(), logs.get(0).contains("test info with tracerId")); }