0
私は、次のコードを持っている:リダイレクトSystem.out.errは動作しません
private void replaceStdIo(SocketChannel socketChannel) throws IOException {
socketChannel.configureBlocking(blockingMode);
InputStream in = new RedirectorInputStream();
PrintStream out = new PrintStream(new RedirectorOutputStream(), false, charsetEncoding);
System.setIn(in);
System.setErr(out);
System.setOut(out);
}
それは私が私のサーバーのうち、情報を取得するために使用大きなTelnetのクラスの一部です。現在の問題は、私にロガーがあることです。私はTelnet Consoleにすべてのロガーを出力したいが、System.out.printだけが動作する。 System.errも動作するはずですが、なんらかの理由でそれが動作しませんか?
これは、IDEでのコンソール出力です:
14:06:42:0723.: From ConsoleIn.java -> Found the Commandinput FINEST in
setDebugLevel(FINEST)
14:06:42:0725.: From Debug.java -> Set debugLevel to FINEST
しかし、これはのSystem.outを持つ唯一のすべて、PC上でのTelnetコンソールにプリントアウトされません。なぜ誰にも分かりませんか?