Changeset c4f9485e


Ignore:
Timestamp:
May 20, 2012 6:12:41 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
1da1dce
Parents:
9cff4d5
Message:
  • Console: Add full file path to thread dump message
Location:
apps/routerconsole/java/src/net/i2p/router/web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java

    r9cff4d5 rc4f9485e  
    11package net.i2p.router.web;
    22
     3import java.io.File;
    34import java.io.IOException;
    45import java.util.List;
     
    209210                addFormError("Warning: unable to contact the service manager - " + t.getMessage());
    210211            }
    211             addFormNotice("Threads dumped to wrapper.log");
     212            File wlog = LogsHelper.wrapperLogFile(_context);
     213            addFormNotice(_("Threads dumped to {0}", wlog.getAbsolutePath()));
    212214        } else if (_("View console on startup").equals(_action)) {
    213215            browseOnStartup(true);
  • apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java

    r9cff4d5 rc4f9485e  
    44import java.util.List;
    55
     6import net.i2p.I2PAppContext;
    67import net.i2p.util.FileUtil;
    78import net.i2p.util.VersionComparator;
     
    3334    }
    3435   
    35     public String getServiceLogs() {
     36    /**
     37     *  Does not necessarily exist.
     38     *  @since 0.9.1
     39     */
     40    static File wrapperLogFile(I2PAppContext ctx) {
    3641        File f = null;
    37         if (_context.hasWrapper()) {
     42        if (ctx.hasWrapper()) {
    3843            String wv = System.getProperty("wrapper.version");
    3944            if (wv != null && (new VersionComparator()).compare(wv, LOCATION_AVAILABLE) >= 0) {
     
    5257                f = new File(System.getProperty("java.io.tmpdir"), "wrapper.log");
    5358                if (!f.exists())
    54                     f = new File(_context.getBaseDir(), "wrapper.log");
     59                    f = new File(ctx.getBaseDir(), "wrapper.log");
    5560            }
    5661        }
     62        return f;
     63    }
     64
     65    public String getServiceLogs() {
     66        File f = wrapperLogFile(_context);
    5767        String str = FileUtil.readTextFile(f.getAbsolutePath(), 250, false);
    5868        if (str == null)
Note: See TracChangeset for help on using the changeset viewer.