#2037 closed enhancement (fixed)

Router should not redirect System.out and System.err

Reported by: ocean1 Owned by: zzz
Priority: minor Milestone: 0.9.32
Component: router/general Version: 0.9.31
Keywords: Cc:
Parent Tickets:

Description

PROBLEM:

Right now when a Router starts up it will redirect System.out and System.err to the wrapper.log file. This plays havoc with an application that embeds the Router.

See this code in WorkingDir?.java: https://github.com/i2p/i2p.i2p/blob/master/router/java/src/net/i2p/router/startup/WorkingDir.java#L277

WORK-AROUND:

Applications can short-circuit this behavior using the code:

System.setProperty("wrapper.version", "NO_WRAPPER");

PROPOSED SOLUTION:

Ideally the router would look for positive confirmation that a wrapper is doing is being used before redirecting System.out and System.err. There should perhaps be a system property and/or a static method that tests whether a wrapper is in use.

Subtickets

Change History (2)

comment:1 Changed 21 months ago by zzz

  • Milestone changed from undecided to 0.9.32
  • Owner set to zzz
  • Status changed from new to accepted
  • Type changed from defect to enhancement

We do look for "positive confirmation" - that's the check for wrapper.version. That IS the system property.

However, there are other places in the code that rely on that also, so the workaround isn't great.

We'd be happy to add a new property, similar to the other ones (see Router.java line 130 if you haven't yet). Probably I2P_DISABLE_OUTPUT_OVERRIDE

comment:2 Changed 21 months ago by zzz

  • Resolution set to fixed
  • Status changed from accepted to closed

In 2a6889552fa84500fb788acca7263ddecc96d791 0.9.31-2

Note: See TracTickets for help on using tickets.