oxsean commented on code in PR #15448:
URL: https://github.com/apache/dubbo/pull/15448#discussion_r2140432647


##########
dubbo-common/src/main/java/org/apache/dubbo/common/logger/log4j2/Log4j2Logger.java:
##########
@@ -17,113 +17,129 @@
 package org.apache.dubbo.common.logger.log4j2;
 
 import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.support.FailsafeLogger;
+
+import org.apache.logging.log4j.Level;
 
 public class Log4j2Logger implements Logger {
 
-    private final org.apache.logging.log4j.Logger logger;
+    private final String fqcn;
+
+    private final org.apache.logging.log4j.spi.ExtendedLogger logger;
+
+    public Log4j2Logger(org.apache.logging.log4j.spi.ExtendedLogger logger) {
+        this.fqcn = FailsafeLogger.class.getName();
+        this.logger = logger;
+    }
 
-    public Log4j2Logger(org.apache.logging.log4j.Logger logger) {
+    public Log4j2Logger(String fqcn, 
org.apache.logging.log4j.spi.ExtendedLogger logger) {
+        this.fqcn = fqcn;
         this.logger = logger;
     }
 
     @Override
     public void trace(String msg) {
-        logger.trace(msg);
+        logger.logIfEnabled(fqcn, Level.TRACE, null, 
logger.getMessageFactory().newMessage(msg), null);

Review Comment:
   Why not use `void logIfEnabled(String fqcn, Level level, Marker marker, 
String message)`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to