Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
antai-sport-http-server
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
antai-sport
antai-sport-http-server
Commits
f7ee0588
Commit
f7ee0588
authored
Apr 25, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生产环境日志上传阿里云服务
parent
8e4a29a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
1 deletion
+72
-1
application-prod.yaml
server-api/src/main/resources/application-prod.yaml
+4
-1
logback-spring-prod.xml
server-api/src/main/resources/logback-spring-prod.xml
+68
-0
No files found.
server-api/src/main/resources/application-prod.yaml
View file @
f7ee0588
...
...
@@ -9,4 +9,7 @@ spring:
password
:
ENC(UgcvbmfTyoBY7fyKdpGFyiKZj7ICxY21K1P8o7UITfI=)
swagger
:
enable
:
true
\ No newline at end of file
enable
:
true
logging
:
config
:
classpath:logback-spring-prod.xml
\ No newline at end of file
server-api/src/main/resources/logback-spring-prod.xml
0 → 100644
View file @
f7ee0588
<configuration>
<!--为了防止进程退出时,内存中的数据丢失,请加上此选项-->
<shutdownHook
class=
"ch.qos.logback.core.hook.DelayingShutdownHook"
/>
<appender
name=
"stdout"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder>
<pattern>
%d [%thread] %-5level %logger{36} [%file : %line] - %msg%n
</pattern>
</encoder>
</appender>
<appender
name=
"aliyunAppender"
class=
"com.aliyun.openservices.log.logback.LoghubAppender"
>
<!--必选项-->
<!-- 账号及网络配置 -->
<endpoint>
cn-shanghai.log.aliyuncs.com
</endpoint>
<accessKeyId>
LTAI5tJag75RdSQiVopwRdhc
</accessKeyId>
<accessKeySecret>
ShrA1zdrCRevavWUU9GwgyIodMFB2F
</accessKeySecret>
<!-- sls 项目配置 -->
<project>
shanghaijingji-sport-prod
</project>
<logStore>
server-api
</logStore>
<!--必选项 (end)-->
<!-- 可选项 详见 '参数说明'-->
<totalSizeInBytes>
104857600
</totalSizeInBytes>
<maxBlockMs>
60000
</maxBlockMs>
<ioThreadCount>
8
</ioThreadCount>
<batchSizeThresholdInBytes>
524288
</batchSizeThresholdInBytes>
<batchCountThreshold>
4096
</batchCountThreshold>
<lingerMs>
2000
</lingerMs>
<retries>
10
</retries>
<baseRetryBackoffMs>
100
</baseRetryBackoffMs>
<maxRetryBackoffMs>
100
</maxRetryBackoffMs>
<!-- 可选项 通过配置 encoder 的 pattern 自定义 log 的格式 -->
<encoder>
<pattern>
%d %-5level [%thread] %logger{0}: %msg
</pattern>
</encoder>
<!-- 可选项 设置 time 字段呈现的格式 -->
<timeFormat>
yyyy-MM-dd'T'HH:mmZ
</timeFormat>
<!-- 可选项 设置 time 字段呈现的时区 -->
<timeZone>
UTC+8
</timeZone>
</appender>
<appender
name=
"fileAppender"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"
>
<!-- daily rollover -->
<fileNamePattern>
/usr/local/project/server-api/logs/logFile.%d{yyyy-MM-dd}-%i.log
</fileNamePattern>
<!-- keep 30 days' worth of history capped at 3GB total size -->
<maxHistory>
30
</maxHistory>
<maxFileSize>
100MB
</maxFileSize>
<totalSizeCap>
3GB
</totalSizeCap>
</rollingPolicy>
<!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder
by default -->
<encoder>
<pattern>
%d %-5level [%thread] %logger{0}: %msg %n
</pattern>
</encoder>
</appender>
<root>
<level
value=
"INFO"
/>
<!-- <appender-ref ref="stdout"/>-->
<appender-ref
ref=
"fileAppender"
/>
<appender-ref
ref=
"aliyunAppender"
/>
</root>
</configuration>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment