forked from I2P_Developers/i2p.i2p
* helper to read the last few lines of a textfile
* use that to render the last few lines of the wrapper log on /logs.jsp (for the on demand stack trace) * thread creation / finalization logging * support a hard restart (stop immediately and restart the JVM) - useful for rerunning clients.config (etc) * systray when not supported
This commit is contained in:
@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.router.RouterContext;
|
||||
|
||||
public class LogsHelper {
|
||||
@ -39,4 +40,12 @@ public class LogsHelper {
|
||||
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public String getServiceLogs() {
|
||||
String str = DataHelper.readTextFile("logs/wrapper.log", 500);
|
||||
if (str == null)
|
||||
return "";
|
||||
else
|
||||
return "<pre>" + str + "</pre>";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user