我想在tomcat启动时关闭liquibase日志记录。
这是我的log4j2.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" monitorInterval="30">
<Properties>
<Property name="LOG_PATTERN">
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%t] %c{1} - %msg%n
</Property>
</Properties>
<Appenders>
<Console name="ConsoleAppender" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="${LOG_PATTERN}"/>
</Console>
<!-- Rolling File Appender -->
<RollingFile name="FileAppender" fileName="logs/test.log"
filePattern="logs/test-%d{yyyy-MM-dd}-%i.log">
<PatternLayout>
<Pattern>${LOG_PATTERN}</Pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1"/>
<SizeBasedTriggeringPolicy size="10MB"/>
</Policies>
<DefaultRolloverStrategy max="10"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="ConsoleAppender"/>
<AppenderRef ref="FileAppender"/>
</Root>
</Loggers>
</Configuration>
log4j2吐出许多日志,这是我要关闭的日志之一( liquibase.servicelocator )
17:31:14.690 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.BlobType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.691 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.NVarcharType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.691 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.SmallIntType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.691 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.UnknownType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.691 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.TimeType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.692 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: interface liquibase.datatype.DataTypeInfo in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.692 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.DataTypeFactory$1 in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.692 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.VarcharType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.692 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.BooleanType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.693 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.XMLType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.693 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.MediumIntType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.693 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.DateType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.693 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.DateTimeType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.693 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.NumberType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.693 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.DoubleType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.694 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.ClobType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.694 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.FloatType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.694 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.CharType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.694 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.DatabaseFunctionType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.694 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.LiquibaseDataType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.694 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.UUIDType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.695 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.DatabaseDataType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.695 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.DecimalType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.695 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.TinyIntType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.696 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.DataTypeFactory in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.696 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.NCharType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.696 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.IntType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd
17:31:14.696 [localhost-startStop-1] DEBUG liquibase.servicelocator.DefaultPackageScanClassResolver - Loaded the class: class liquibase.datatype.core.CurrencyType in classloader: jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd