无法 运行 Log4j2 演示 class - 当 运行 将 class 作为 Java 应用程序时,屏幕上弹出 Java 异常

unable to run the Log4j2 demo class - While running the class as Java application, Java exception popped out on screen

这是我创建的用于测试 log4j 属性的演示 class

属性 文件如给定

请帮助我理解为什么我无法 运行 Log4j class

控制台输出

Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: org.apache.logging.log4j.core.config.ConfigurationException: No type attribute provided for Appender console
    at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationBuilder.createAppender(PropertiesConfigurationBuilder.java:216)
    at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationBuilder.build(PropertiesConfigurationBuilder.java:151)
    at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationFactory.getConfiguration(PropertiesConfigurationFactory.java:56)
    at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationFactory.getConfiguration(PropertiesConfigurationFactory.java:35)
    at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:558)
    at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:482)
    at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:322)
    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:696)
    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:717)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:272)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
    at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:599)
    at utilities.Log4j.<clinit>(Log4j.java:8)

看来你不见了;

appender.console.type = 控制台

参见此处示例: https://logging.apache.org/log4j/2.x/manual/configuration.html