簡體   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