我有这样的配置文件:-
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration PUBLIC
"-//APACHE//DTD LOG4J 1.2//EN" "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />
</layout>
</appender>
<appender name="file" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="EMRSparkTransformer/application.log" />
<param name="Append" value="false" />
<layout class="net.logstash.log4j.JSONEventLayoutV1">
</layout>
</appender>
<logger name="com.X" additivity="false">
<level value="INFO" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</logger>
<root>
<level value="ERROR" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
</log4j:configuration>
我想从合并在阴影jar中的所有jar中获取记录器:- 我的项目结构:-
com
-x
-y
org
-A
-B
我想要两个项目的记录器。 如何在Logger中使用正则表达式,例如:-
<logger name="*" additivity="false">
<level value="INFO" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</logger>
谢谢