繁体   English   中英

将System.out发送到文件和Commons Logging

[英]Sending System.out to a file and Commons Logging

我正在使用公共记录:

  private static final Log LOG = LogFactory.getLog(MyClass.class);

为什么在我运行时这些日志没有进入日志文件

sh Main 2>&1 > logfile

我正在使用默认属性,并且classpath中没有log4j.properties。

您有向后重定向。 它们是从左到右处理的。 尝试这个:

sh Main > logfile 2>&1 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM