From efdb99f8cecc4afb592afad79c761081d5d5cf22 Mon Sep 17 00:00:00 2001 From: lee <4766465@qq.com> Date: Wed, 18 Dec 2024 13:27:00 +0800 Subject: [PATCH] init --- yami-shop-api/src/main/resources/logback/logback-prod.xml | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/yami-shop-api/src/main/resources/logback/logback-prod.xml b/yami-shop-api/src/main/resources/logback/logback-prod.xml new file mode 100644 index 0000000..a7dfa16 --- /dev/null +++ b/yami-shop-api/src/main/resources/logback/logback-prod.xml @@ -0,0 +1,39 @@ +<configuration scan="true" scanPeriod="60 seconds" debug="false"> + <property name="PROJECT_PATH" value="/opt/projects/yami-b2b2c"/> + <property name="LOG_FILE_MAX_HISTORY" value="30"/> + <property name="LOG_FILE_MAX_SIZE" value="50MB"/> + + + <include resource="org/springframework/boot/logging/logback/defaults.xml" /> + <include resource="org/springframework/boot/logging/logback/console-appender.xml" /> + + <appender name="DefaultFile" + class="ch.qos.logback.core.rolling.RollingFileAppender"> + <append>true</append> + <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> + <pattern>${FILE_LOG_PATTERN}</pattern> + <charset>UTF-8</charset> + </encoder> + <file>${PROJECT_PATH}/log/api.log</file> + + <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> + <level>${logging.level}</level> + </filter> + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> + <fileNamePattern>${PROJECT_PATH}/log/api/%d{yyyy-MM}/api-%d{yyyy-MM-dd}-%i.log.gz</fileNamePattern> + <maxFileSize>${LOG_FILE_MAX_SIZE}</maxFileSize> + <maxHistory>${LOG_FILE_MAX_HISTORY}</maxHistory> + </rollingPolicy> + </appender> + + <root level="info"> + <appender-ref ref="CONSOLE" /> + <appender-ref ref="DefaultFile" /> + </root> + + <logger name="com.yami.shop" level="debug"/> + <logger name="springfox.documentation.swagger2" level="off"/> + <logger name="io.swagger.models.parameters" level="off"/> + <logger name="springfox.documentation.swagger.readers.operation.OperationImplicitParameterReader" level="off"/> + <logger name="springfox.documentation.spring.web.readers.operation" level="off"/> +</configuration> -- Gitblit v1.9.3