* i2prouter:

- Don't cd to script location, no longer required
    * RouterLaunch:
      - If no wrapper, put wrapper.log in system temp dir
        unless specified with -Dwrapper.logfile=/path/to/wrapper.log
        or it already exists in CWD (for backward compatibility)
      - Append rather than replace wrapper.log
      - Pass wrapper log location to router as a property, so that logs.jsp can find it
    * logs.jsp:
      - Get wrapper log location from a property too
    * runplain.sh:
      - Add path substitution to runplain.sh on install
      - Pass I2P base dir to the router as a property
    * wrapper.config:
      - Put wrapper.log in system temp dir for new installs
      - Pass I2P base dir to the router as a property
    * WorkingDir:
      - Don't migrate an existing install by default
      - Never migrate the data (too hard)
This commit is contained in:
zzz
2009-06-13 21:04:27 +00:00
parent 718375419e
commit 24daf00616
7 changed files with 94 additions and 64 deletions

View File

@ -17,16 +17,23 @@ public class LogsHelper extends HelperBase {
}
public String getServiceLogs() {
// look in new and old place
File f = new File(_context.getLogDir(), "wrapper.log");
if (!f.exists())
f = new File(_context.getBaseDir(), "wrapper.log");
// RouterLaunch puts the location here if no wrapper
String path = System.getProperty("wrapper.logfile");
File f;
if (path != null) {
f = new File(path);
} else {
// look in new and old places
f = new File(System.getProperty("java.io.tmpdir"), "wrapper.log");
if (!f.exists())
f = new File(_context.getBaseDir(), "wrapper.log");
}
String str = FileUtil.readTextFile(f.getAbsolutePath(), 250, false);
if (str == null)
return "";
else {
str = str.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
return "<pre>" + str + "</pre>";
return "Location: " + f.getAbsolutePath() + "<pre>" + str + "</pre>";
}
}