You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2023/01/11 16:53:46 UTC

[GitHub] [bookkeeper] Shawyeok commented on a diff in pull request #3584: [improve] Optimize log4j configuration

Shawyeok commented on code in PR #3584:
URL: https://github.com/apache/bookkeeper/pull/3584#discussion_r1067232558


##########
conf/log4j2.xml:
##########
@@ -28,13 +28,13 @@
     </Properties>
     <Appenders>
         <Console name="CONSOLE" target="SYSTEM_OUT">
-            <PatternLayout pattern="%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n"/>
+            <PatternLayout pattern="%d{ISO8601} - %-5p - [%t:%c{1}] - %m%n"/>
         </Console>
         <File name="TRACEFILE" fileName="${sys:bookkeeper.log.dir}/bookkeeper-trace.log">
-            <PatternLayout pattern="%d{ISO8601} - %-5p [%t:%C{1}@%L][%ndc] - %m%n"/>
+            <PatternLayout pattern="%d{ISO8601} - %-5p [%t:%c{1}][%ndc] - %m%n"/>
         </File>
         <RollingFile name="ROLLINGFILE" fileName="${sys:bookkeeper.log.dir}/${sys:bookkeeper.log.file}" filePattern="${sys:bookkeeper.log.dir}/${sys:bookkeeper.log.file}%d{.yyyy-MM-dd}">
-            <PatternLayout pattern="%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n"/>
+            <PatternLayout pattern="%d{ISO8601} - %-5p [%t:%c{1}] - %m%n"/>

Review Comment:
   `%d{ISO8601} [%t] %-5level %logger - %m%n%ex`
   
   @hangc0276  How about this?
   - %-5p and %-5level is identical but later is more readable
   - %logger is identical with %c, logger name with full package name, pay a little more disk space
   - the `-` after timestamp is redundant
   - %ex is to prevent default %xEx, which is to add packaging information about each stack trace element, that means more cost. see more: `org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter`



-- 
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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org