⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mail-2001-03-12t1454

📁 实现在电脑平台上控制短信modem或手机进行通讯的jar包和相关实例
💻
字号:
Copied from:http://www.mail-archive.com/log4j-user@jakarta.apache.org/msg00433.html--------------------------------------------------------------------------------RE: diverting System.stderr/stdout into log4j--------------------------------------------------------------------------------From: Jim Moore Subject: RE: diverting System.stderr/stdout into log4j Date: Mon, 12 Mar 2001 14:54:13 -0800 --------------------------------------------------------------------------------It doesn't.  I haven't worried about it, since log4j doesn't contain anybugs and therefore it would never happen... :)Probably the best way to handle it is to add aLogLog.setPrintStream(PrintStream) method, so you can do something like:// remember STDERRPrintStream se = System.err;// make sure everything sent to System.err is loggedSystem.setErr(new PrintStream(new LoggingOutputStream(Category.getRoot(),              Priority.WARN), true));// make sure everything sent to System.out is also loggedSystem.setOut(new PrintStream(new LoggingOutputStream(Category.getRoot(),              Priority.INFO), true));// prevent infinate recursion in LogLogLogLog.setPrintStream(se);I can't think of any other way to do it in the current version besidesgetting extremely kludgey by checking the stack to see if it's being calledfrom LogLog and logging out the the "real" STDERR then in theLoggingOutputStream.  It can be done on the theory that LogLog wouldn't becalled very often, but still...-Jim Moore-----Original Message-----From: Ceki G黮c

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -