开发者

Sending System.out to a file and Commons Logging

开发者 https://www.devze.com 2023-02-05 20:59 出处:网络
I am using commons logging: private static final Log LOG = LogFactory.getLog(MyClass.class); Why those logs doesn\'t go into the log file when I run

I am using commons logging:

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

Why those logs doesn't go into the log file when I run

sh Main 2>&1 > logfil开发者_StackOverflow社区e

I am using the default properties and no log4j.properties are in the classpath.


You have the redirections backwards. They're processed from left to right. Try this:

sh Main > logfile 2>&1 
0

精彩评论

暂无评论...
验证码 换一张
取 消