This is an automated email from the ASF dual-hosted git repository.

gaoxihui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozhera.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c3fe95e fix:  Solves the logical problem of reading nacos 
configuration for processing (#565)
4c3fe95e is described below

commit 4c3fe95e50f27262d099c33a458594c457eac184
Author: Xue <[email protected]>
AuthorDate: Mon Mar 17 16:18:14 2025 +0800

    fix:  Solves the logical problem of reading nacos configuration for 
processing (#565)
    
    - Solves the logical problem of reading nacos configuration for processing
    - Added some logs to make it easier to view problems
    
    Co-authored-by: xueshan <[email protected]>
---
 .../org/apache/ozhera/log/agent/channel/AbstractChannelService.java   | 1 +
 .../log/manager/service/nacos/ManagerLevelFilterConfigListener.java   | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/channel/AbstractChannelService.java
 
b/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/channel/AbstractChannelService.java
index fb2633aa..5fbf3fa3 100644
--- 
a/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/channel/AbstractChannelService.java
+++ 
b/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/channel/AbstractChannelService.java
@@ -213,6 +213,7 @@ public abstract class AbstractChannelService implements 
ChannelService {
         if (line.length() > FILTER_LOG_PREFIX_LENGTH) {
             line = line.substring(0, FILTER_LOG_PREFIX_LENGTH);
         }
+        log.info("The current log information to be filtered is {}, the log 
level to be filtered is {}", line, logLevelList);
         String lineLowerCase = line.toLowerCase();
         for (String level : logLevelList) {
             if (lineLowerCase.contains(level.toLowerCase())) {
diff --git 
a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/nacos/ManagerLevelFilterConfigListener.java
 
b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/nacos/ManagerLevelFilterConfigListener.java
index bfb72ea1..e99ba3d4 100644
--- 
a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/nacos/ManagerLevelFilterConfigListener.java
+++ 
b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/nacos/ManagerLevelFilterConfigListener.java
@@ -112,7 +112,8 @@ public class ManagerLevelFilterConfigListener {
             if (newConfig != null) {
                 List<MilogLogTailDo> newLogtailList = 
logtailDao.getMilogLogtail(newConfig.getTailIdList());
                 newLogtailList.forEach(tail -> 
tail.setFilterLogLevelList(newConfig.getLogLevelList()));
-                oldLogtailList = oldLogtailList.stream().filter(tail -> 
!newLogtailList.contains(tail)).toList();
+                List<Long> newIdList = 
newLogtailList.stream().map(MilogLogTailDo::getId).toList();
+                oldLogtailList = oldLogtailList.stream().filter(tail -> 
!newIdList.contains(tail.getId())).toList();
                 updateMilogLogtailList.addAll(newLogtailList);
             }
             oldLogtailList.forEach(tail -> tail.setFilterLogLevelList(new 
ArrayList<>()));
@@ -121,6 +122,7 @@ public class ManagerLevelFilterConfigListener {
             for (MilogLogTailDo tailDo : updateMilogLogtailList) {
                 boolean isSuccess = logtailDao.update(tailDo);
                 if (isSuccess){
+                    log.info("update tail and send to agent, the message of 
tail is: {}", tailDo);
                     updateSingleTail(tailDo);
                 }
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to