log4j中Logger.getLogger()加載一個類提示錯誤


轉載自:https://blog.csdn.net/q3229270/article/details/77986687 

-----------------------------

錯誤提示如下:The method getLogger(String) in the type Logger is not applicable for the arguments (Class<TestMyBatis>)

等我知道這個報錯的原因時,覺得自己粗心。

因為import錯了包

我導入的:import java.util.logging.Logger;

應該導入:import org.apache.log4j.Logger;

 

如上圖,記下來以后別再犯這類的錯誤。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM