Changeset 46af643 for apps/jetty


Ignore:
Timestamp:
Jan 6, 2016 5:45:35 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
144f54e
Parents:
2698076
Message:

Change default source logging from b64 to b32.
To change back to b64, add the following to the RequestLogImpl?
section of jetty.xml:

<Set name="b64">true</Set>

Location:
apps/jetty/java/src/net/i2p/jetty
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/jetty/java/src/net/i2p/jetty/I2PLogger.java

    r2698076 r46af643  
    3232    private final Log _log;
    3333   
    34     StringBuilder _buffer = new StringBuilder();
    35    
    36     static {
     34    private final StringBuilder _buffer = new StringBuilder();
     35   
     36    //static {
    3737        // So people don't wonder where the logs went
    38         System.out.println("INFO: Jetty " + Server.getVersion() + " logging to I2P logs using class " + Server.class.getName());
    39     }
     38        //System.out.println("INFO: Jetty " + Server.getVersion() + " logging to I2P logs using class " + Server.class.getName());
     39    //}
    4040
    4141    public I2PLogger()
  • apps/jetty/java/src/net/i2p/jetty/I2PRequestLog.java

    r2698076 r46af643  
    7777    private boolean _logCookies = false;
    7878    private boolean _logServer = false;
     79    private boolean _b64;
    7980   
    8081    private transient OutputStream _out;
     
    241242    {
    242243        _preferProxiedForAddress = preferProxiedForAddress;
     244    }
     245
     246    /**
     247     * @param b64 true to enable base 64 logging. False for base 32 logging. Default false.
     248     * @since 0.9.24
     249     */
     250    public void setB64(boolean b64)
     251    {
     252        _b64 = b64;
    243253    }
    244254
     
    281291
    282292                if (addr == null) {
    283                     // TODO offer B32 option
    284                     addr = request.getHeader("X-I2P-DestHash");
    285                     if(addr != null)
    286                         addr += ".i2p";
    287                     else
     293                    if (_b64) {
     294                        addr = request.getHeader("X-I2P-DestHash");
     295                        if (addr != null)
     296                            addr += ".i2p";
     297                    } else {
     298                        // 52chars.b32.i2p
     299                        addr = request.getHeader("X-I2P-DestB32");
     300                    }
     301                    if (addr == null)
    288302                        addr = request.getRemoteAddr();
    289303                }
Note: See TracChangeset for help on using the changeset viewer.