Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
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
wangpeng
dinky
Commits
e8db2094
Unverified
Commit
e8db2094
authored
May 10, 2023
by
Licho
Committed by
GitHub
May 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add log delete strategy (#1956)
* feat: add log delete strategy Signed-off-by:
Licho
<
lecho.sun@gmail.com
>
* fix: log path --------- Signed-off-by:
Licho
<
lecho.sun@gmail.com
>
parent
2a59585d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
WatchTableServiceImpl.java
...in/java/org/dinky/service/impl/WatchTableServiceImpl.java
+3
-2
log4j2.xml
dinky-admin/src/main/resources/log4j2.xml
+11
-0
No files found.
dinky-admin/src/main/java/org/dinky/service/impl/WatchTableServiceImpl.java
View file @
e8db2094
...
@@ -33,6 +33,7 @@ import java.util.function.Consumer;
...
@@ -33,6 +33,7 @@ import java.util.function.Consumer;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
org.springframework.messaging.MessagingException
;
import
org.springframework.messaging.simp.SimpMessagingTemplate
;
import
org.springframework.messaging.simp.SimpMessagingTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -62,8 +63,8 @@ public class WatchTableServiceImpl implements WatchTableService {
...
@@ -62,8 +63,8 @@ public class WatchTableServiceImpl implements WatchTableService {
if
(
destinations
!=
null
)
{
if
(
destinations
!=
null
)
{
destinations
.
forEach
(
d
->
this
.
messagingTemplate
.
convertAndSend
(
d
,
data
[
1
]));
destinations
.
forEach
(
d
->
this
.
messagingTemplate
.
convertAndSend
(
d
,
data
[
1
]));
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Messaging
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
toString
());
}
}
}
}
...
...
dinky-admin/src/main/resources/log4j2.xml
View file @
e8db2094
...
@@ -42,6 +42,17 @@
...
@@ -42,6 +42,17 @@
<!--当app.log文件大小到达100MB的时候,就归档一次日志文件,也就是把app.log中的那前面100MB文件取出来,放到上面<RollingFile >中的filePattern后面的路径中-->
<!--当app.log文件大小到达100MB的时候,就归档一次日志文件,也就是把app.log中的那前面100MB文件取出来,放到上面<RollingFile >中的filePattern后面的路径中-->
<SizeBasedTriggeringPolicy
size=
"100MB"
/>
<SizeBasedTriggeringPolicy
size=
"100MB"
/>
</Policies>
</Policies>
<DefaultRolloverStrategy>
<!--
* only files in the log folder, no sub folders
* only rolled over log files (name match)
* only files that are 4 days old or older
-->
<Delete
basePath=
"${LOG_PATH}/"
maxDepth=
"1"
>
<IfFileName
glob=
"*-ws-.log"
/>
<IfLastModified
age=
"3d"
/>
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
</RollingFile>
</appenders>
</appenders>
...
...
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