我收到以下错误:
1 error found:
File: C:\Users\adem\Desktop\various_topics\JavaProjects\log4jExample.java [line: 15]
Error: cannot find symbol
symbol: method getLogger(java.lang.String)
location: interface org.apache.logging.log4j.Logger
这是我的代码,基于本教程:
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.*;
public class log4jExample{
/* Get actual class name to be printed on */
static Logger log = Logger.getLogger(log4jExample.class.getName()); //.getName()
public static void main(String[] args)
throws IOException,SQLException{
log.debug("Hello this is an debug message");
log.info("Hello this is an info message");
}
}
谢谢!