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
8e4a29a8
Commit
8e4a29a8
authored
Apr 25, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生产环境日志上传阿里云服务
parent
700d692c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
2 deletions
+84
-2
pom.xml
common/pom.xml
+4
-0
application-dev.yaml
mobile-api/src/main/resources/application-dev.yaml
+2
-1
application-prod.yaml
mobile-api/src/main/resources/application-prod.yaml
+4
-1
logback-spring-prod.xml
mobile-api/src/main/resources/logback-spring-prod.xml
+68
-0
pom.xml
pom.xml
+6
-0
No files found.
common/pom.xml
View file @
8e4a29a8
...
...
@@ -86,5 +86,9 @@
<groupId>
com.aliyun
</groupId>
<artifactId>
aliyun-java-sdk-dysmsapi
</artifactId>
</dependency>
<dependency>
<groupId>
com.aliyun.openservices
</groupId>
<artifactId>
aliyun-log-logback-appender
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
mobile-api/src/main/resources/application-dev.yaml
View file @
8e4a29a8
...
...
@@ -22,3 +22,4 @@ aliyun:
time-out
:
1000
template-code
:
login
:
SMS_136440120
#登录确认验证码
mobile-api/src/main/resources/application-prod.yaml
View file @
8e4a29a8
...
...
@@ -22,3 +22,6 @@ aliyun:
time-out
:
1000
template-code
:
login
:
SMS_136440120
#登录确认验证码
logging
:
config
:
classpath:logback-spring-prod.xml
\ No newline at end of file
mobile-api/src/main/resources/logback-spring-prod.xml
0 → 100644
View file @
8e4a29a8
<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>
mobile-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/mobile-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>
pom.xml
View file @
8e4a29a8
...
...
@@ -41,6 +41,7 @@
<aliyun-sdk.version>
4.4.6
</aliyun-sdk.version>
<aliyun-dysmsapi.version>
1.1.0
</aliyun-dysmsapi.version>
<org.mapstruct.version>
1.4.2.Final
</org.mapstruct.version>
<aliyun-log.version>
0.1.15
</aliyun-log.version>
<maven.compiler.source>
11
</maven.compiler.source>
<maven.compiler.target>
11
</maven.compiler.target>
...
...
@@ -123,6 +124,11 @@
<artifactId>
mapstruct
</artifactId>
<version>
${org.mapstruct.version}
</version>
</dependency>
<dependency>
<groupId>
com.aliyun.openservices
</groupId>
<artifactId>
aliyun-log-logback-appender
</artifactId>
<version>
${aliyun-log.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
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