I want to get the mesos logs by org.apache.mesos.Log
, but the API is too little about it. I don't know How to use the "Writer" and the "Reader". When I create a new Log, there are some files created, but I don't even know what does it mean. Is there any one who had ever used it?
this is my code
public class MyMesosLog {
private static org.apache.mesos.Log log;
private static Log getLog(){
return log == null ? new Log(2,"/Users/wangyao/Desktop","localhost:2181",2000, TimeUnit.MILLISECONDS,"mesos") : log;
}
private static Log.Writer getWriter(){
return new Log.Writer(log,2000,TimeUnit.MILLISECONDS,5);
}
private static Log.Reader getReader(){
return new Log.Reader(log);
}
public static void main(String[] args){
MyMesosLog.getLog();
}
}
the result is: just 5 files created on my desktop, There is nothing in these files except a file named Log, that is the information:
2015/06/10-14:14:14.688716 1019f3000 Recovering log #12
2015/06/10-14:14:14.691651 1019f3000 Delete type=0 #12
2015/06/10-14:14:14.691729 1019f3000 Delete type=3 #10
2015/06/10-14:14:14.693408 1211e4000 Level-0 table #17: started
2015/06/10-14:14:14.693583 1211e4000 Level-0 table #17: 0 bytes OK
2015/06/10-14:14:14.694033 1211e4000 Delete type=0 #15
2015/06/10-14:14:14.694285 1211e4000 Manual compaction at level-0 from (begin) .. (end); will stop at (end)
The result I want to get is like in this Mesos url : http://localhost:5050/#/ I can find the logs of task, for example :Launcher.log ,stderr and stdout
The
Log
is not about accessing log messages, but about storing data in Mesos own replicated log (a distributed data storage).see also: http://mesos.apache.org/blog/mesos-0-17-0-released-featuring-autorecovery/