IDEA 配置默认pom,logback模板,XML模板
Default pom模板
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>${GROUP_ID}</groupId> <artifactId>${ARTIFACT_ID}</artifactId> <version>1.0.0</version> <packaging>jar</packaging> <name>${ARTIFACT_ID}</name> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> </dependencies> <build> <finalName>${ARTIFACT_ID}</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <compilerVersion>1.8</compilerVersion> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> <compilerArgs> <arg>-parameters</arg> </compilerArgs> </configuration> </plugin> </plugins> </build> </project>
Logback Config模板
<?xml version="1.0" encoding="utf-8"?> <configuration scan="false" debug="false"> <!-- TODO 非dev环境用/tmp/gateway/${MODULE_NAME},dev环境可以用${user.dir}/logs/warn_nginx_plus --> <property name="LOG_DIR" value="${user.dir}/logs/${MODULE_NAME}" /> <property name="LOG_PATTERN" value="[%-5level] %d{yyyy-MM-dd#HH:mm:ss.SSS} [Thread:%thread] [Logger:%logger] -> %msg%n" /> <appender name="stdAppender" class="ch.qos.logback.core.ConsoleAppender"> <withJansi>true</withJansi> <!-- 如果是UTF-8的环境这句要注释掉 --> <encoder> <pattern>%highlight([%-5level]) %cyan(%d{yyyy-MM-dd#HH:mm:ss.SSS}) %yellow([Thread:%thread]) %magenta([Logger:%logger]) -> %msg%n</pattern> <charset>utf-8</charset> </encoder> </appender> <appender name="fileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>\${LOG_DIR}/log.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- 按天归档,如果按小时后面加-hh --> <fileNamePattern>\${LOG_DIR}/history/%d{yyyy-MM-dd}.gz</fileNamePattern> <maxHistory>30</maxHistory> </rollingPolicy> <append>true</append> <encoder> <pattern>\${LOG_PATTERN}</pattern> <charset>utf-8</charset> </encoder> <!-- 不写TRACE DEBUG --> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <level>INFO</level> </filter> </appender> <root level="DEBUG"> <!-- TODO prod 环境去掉std --> <appender-ref ref="stdAppender"/> <appender-ref ref="fileAppender"/> </root> </configuration>
Default XML Config模板
<?xml version="1.0" encoding="UTF-8"?> <configuration> </configuration>
posted on 2019-08-31 21:27 Silentdoer 阅读(2273) 评论(0) 编辑 收藏 举报