クラスを実行すると、TestJcLLoggingService
ログ メッセージがコンソールに表示されますが、ログ ファイルが作成されません。答えがわかっている場合は、助けてください。
2 つのソース ファイルが下に貼り付けられます。
TestJcLLoggingService.java
package com.amadeus.psp.pasd.logging;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;
@Service
public class TestJCLLoggingService {
private static Log psp_log = LogFactory.getLog(TestJCLLoggingService.class);
public static String testJCLLoggingServiceMethod(){
psp_log.info("start of method testJCLLoggingServiceMethod class TestJCLLoggingService");
psp_log.info("start of method testJCLLoggingServiceMethod class TestJCLLoggingService");
return "This is a test string for JCLLogging";
}
public static void main(String[] args){
testJCLLoggingServiceMethod();
}
}
logging.properties
ハンドラ = java.util.logging.ConsoleHandler、java.util.logging.FileHandler .レベル = すべて com.amadeus.psp.pasd.level=すべて java.util.logging.ConsoleHandler.level = ALL java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter java.util.logging.FileHandler.pattern = %h/java%u.log java.util.logging.FileHandler.level=ALL java.util.logging.FileHandler.limit=50000 java.util.logging.FileHandler.count=1 java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter java.util.logging.FileHandler.append=true
前もって感謝します。