gpt4 book ai didi

logging - 如何关闭 log4j2 中的 Dozer 日志条目?

转载 作者:行者123 更新时间:2023-12-04 13:54:38 25 4
gpt4 key购买 nike

如何关闭 log4j2 中的 Dozer 日志条目?
使用 Java 1.8,Dozer 版本:6.4.1,Windows 7 上的 Logger 版本 2.11.2
pom.xml 配置:

   <groupId>com.github.dozermapper</groupId>
<artifactId>dozer-core</artifactId>
每次我加载网页或运行 JUnit 测试时,Dozer 都会记录 100 行日志消息,这使得应用程序有点慢。尝试在 log4j2.xml 中执行以下配置以关闭 Dozer 消息,但它不会关闭 Dozer INFO 消息。
    <Configuration
xmlns="http://logging.apache.org/log4j/2.0/config" status="WARN">
<Properties>
<Property name="basePath">../cabsys/logs</Property>
</Properties>
<Appenders>
<!-- File Appender -->
<File name="FILE" fileName="${basePath}/cabsys_logfile.log"
append="true">
<PatternLayout
pattern="%-5p | %d{yyyy-MM-dd HH:mm:ss} | [%t] %C{2} (%F:%L) - %m%n" />
</File>
<!-- Console Appender -->
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout
pattern="%-5p | %d{yyyy-MM-dd HH:mm:ss} | [%t] %C{2} (%F:%L) - %m%n" />
<LevelRangeFilter minLevel="INFO" maxLevel="INFO"
onMatch="DENY" onMismatch="NEUTRAL" />
</Console>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="STDOUT" />
<AppenderRef ref="FILE" />
</Root>
</Loggers>

<!-- categories -->
<category name="com.github.dozermapper.core.DozerBeanMapperBuilder">
<priority value="OFF" />
</category>
<category name="com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder">
<priority value="OFF" />
</category>
<category name="com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver">
<priority value="OFF" />
</category>
<category name="com.github.dozermapper.core.util.RuntimeUtils">
<priority value="OFF" />
</category>
<category name="com.github.dozermapper.core.el.ELExpressionFactory">
<priority value="OFF" />
</category>
<category name="com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver">
<priority value="OFF" />
</category>
</Configuration>
推土机日志条目:
`
13:14:52,284 INFO  [com.github.dozermapper.core.util.RuntimeUtils] (default task-2) OSGi support is false
13:14:52,290 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:52,301 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:52,304 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:52,322 INFO [com.github.dozermapper.core.el.ELExpressionFactory] (default task-2) javax.el support is true
13:14:52,388 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:53,009 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,015 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,030 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:53,188 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:53,189 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:53,191 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:53,197 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:53,259 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,261 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,273 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:53,308 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:53,309 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:53,312 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:53,325 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:53,380 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,381 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,394 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:53,425 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:53,426 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:53,429 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:53,435 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:53,498 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,500 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,513 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:53,621 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:53,623 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:53,630 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:53,637 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:53,715 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,718 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,730 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:53,784 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:53,784 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:53,800 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:53,808 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:53,888 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,890 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:53,931 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:54,009 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:54,009 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:54,012 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:54,018 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:54,059 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,061 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,071 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:54,100 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:54,101 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:54,109 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:54,117 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:54,166 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,167 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,179 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:54,234 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:54,235 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:54,237 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:54,243 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:54,281 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,283 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,294 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:54,324 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:54,324 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:54,330 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:54,337 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:54,392 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,393 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,406 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
13:14:54,438 INFO [com.github.dozermapper.core.DozerBeanMapperBuilder] (default task-2) Initializing Dozer. Version: 6.4.1, Thread Name: default task-2
13:14:54,438 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Trying to find Dozer configuration file: dozer.properties
13:14:54,442 INFO [com.github.dozermapper.core.config.resolvers.LegacyPropertiesSettingsResolver] (default task-2) Using URL [vfs:/D:/mh_stuff/E_drive/installed/wildfly-18.0.1.Final/standalone/deployments/cabsys.war/WEB-INF/classes/dozer.properties] for Dozer settings
13:14:54,448 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Using URL [dozerBeanMapping.xml] to load custom xml mappings
13:14:54,486 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Trying to resolve XML entity with public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,486 INFO [com.github.dozermapper.core.builder.xml.SchemaLSResourceResolver] (default task-2) Resolved public ID [null] and system ID [http://dozermapper.github.io/schema/bean-mapping.xsd]
13:14:54,495 INFO [com.github.dozermapper.core.builder.xml.BeanMappingXMLBuilder] (default task-2) Successfully loaded custom xml mapping.
`
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tvaksa.cabsys</groupId>
<artifactId>cabsys</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>cabsys</name>
<url>http://localhost:8080/cabsys</url>

<properties>

<!-- Dependency versions -->
<log4j.version>2.11.2</log4j.version>
<org.mapstruct.version>1.3.1.Final</org.mapstruct.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
</properties>

<dependencies>
<!-- MapStruct Mapper -->
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<scope>provided</scope>
</dependency>

<!-- Dozer Mapper -->
<dependency>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-core</artifactId>
<version>6.4.1</version>
</dependency>

<!-- Apache Logging utilty -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>javax.ejb-api</artifactId>
<version>3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>

<!-- JSF API & Impl -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.11</version>
</dependency>

<!-- https://mvnrepository.com/artifact/javax.enterprise/cdi-api -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0.SP1</version>
<scope>provided</scope>
</dependency>


<!-- primefaces https://mvnrepository.com/artifact/org.primefaces/primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>7.0</version>
</dependency>

<!-- JSF utility library -> Omnifaces -->
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- This will get hamcrest-core automatically -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>

<!-- Hibernate 5.3.5.Final -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.3.5.Final</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.12</version>
</dependency>

<!-- jboss-client.jar -->
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<version>18.0.0.Final</version>
<type>pom</type>
</dependency>
</dependencies>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</reporting>

<build>
<finalName>cabsys</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven
defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>

</plugins>
</pluginManagement>
</build>

</project>
关于如何关闭 Dozer 日志消息的任何建议?谢谢。

最佳答案

您可以使用 logger 来抑制来自包及其子包的日志。下 Loggers元素,尝试添加以下配置 -

        <Logger name="com.github.dozermapper" level="OFF" additivity="false">
<AppenderRef ref="STDOUT" />
<AppenderRef ref="FILE" />
</Logger>

关于logging - 如何关闭 log4j2 中的 Dozer 日志条目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64607194/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com