use of org.apache.commons.io.input.TailerListener in project solr-cmd-utils by tblsoft.
the class Test method tailer.
@org.junit.Test
@Ignore
public void tailer() throws Exception {
TailerListener listener = new MyTailerListener();
Tailer tailer = Tailer.create(new File("/tmp/artifacts/solr.log"), listener, 1000, true);
tailer.run();
}
use of org.apache.commons.io.input.TailerListener in project app-maven-plugin by GoogleCloudPlatform.
the class TailingVerifier method startTailingLog.
private void startTailingLog() {
TailerListener listener = new TailerListenerAdapter() {
@Override
public void handle(String line) {
System.out.println(testName + ": " + line);
}
};
// Tail the log
File file = new File(getBasedir() + File.separator + getLogFileName());
try {
if (file.exists()) {
file.delete();
}
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
Tailer tailer = new Tailer(file, listener, TAIL_DELAY_MILLIS);
Thread thread = new Thread(tailer);
thread.setDaemon(true);
thread.start();
}
Aggregations