我收到Failed to load class "org.slf4j.impl.StaticLoggerBinder"错误.我想将记录器写入文件.所以我使用log4j.jar并使用apache tomcat服务器.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Run Code Online (Sandbox Code Playgroud) 我开发了一个示例Web应用程序,它将从外部属性文件中读取数据.属性文件位于系统的源文件夹中,不包含在WAR文件中.
属性文件的访问方式如下:
Properties prop = new Properties();
//File f1 = new File("Property.properties");
prop.load(getClass().getClassLoader().getResourceAsStream("Property.properties"));
Run Code Online (Sandbox Code Playgroud)