You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mnemonic.apache.org by GitBox <gi...@apache.org> on 2022/03/09 06:21:10 UTC

[GitHub] [mnemonic] bigdata-memory commented on a change in pull request #277: MNEMONIC-728: Update log4j.properties in each subproject folders with log4j2.xml

bigdata-memory commented on a change in pull request #277:
URL: https://github.com/apache/mnemonic/pull/277#discussion_r822319517



##########
File path: mnemonic-collections/src/main/resources/log4j2.xml
##########
@@ -0,0 +1,121 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="warn">
+    <Properties>
+        <Property name="service">api</Property>
+        <Property name="logFileRoot">/data/soft/log</Property>
+        <Property name="pattern">[%p %d] %c{1.} [%t] %m%n</Property>
+    </Properties>
+    <Appenders>
+        <RollingRandomAccessFile name="fileAppender" fileName="${logFileRoot}/${service}.log"

Review comment:
       I suggest that we can just using the following Appender to replace all, thanks.
       <Console name="Console" target="SYSTEM_OUT">
         <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
       </Console>

##########
File path: mnemonic-collections/src/main/resources/log4j2.xml
##########
@@ -0,0 +1,121 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="warn">
+    <Properties>
+        <Property name="service">api</Property>
+        <Property name="logFileRoot">/data/soft/log</Property>
+        <Property name="pattern">[%p %d] %c{1.} [%t] %m%n</Property>
+    </Properties>
+    <Appenders>
+        <RollingRandomAccessFile name="fileAppender" fileName="${logFileRoot}/${service}.log"
+                                 filePattern="${logFileRoot}/bk/${service}-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout>
+                <Pattern>${pattern}</Pattern>
+            </PatternLayout>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
+            </Policies>
+        </RollingRandomAccessFile>
+        <RollingRandomAccessFile name="otherAppender" fileName="${logFileRoot}/${service}-other.log"
+                                 filePattern="${logFileRoot}/bk/${service}-other-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout>
+                <Pattern>${pattern}</Pattern>
+            </PatternLayout>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
+            </Policies>
+        </RollingRandomAccessFile>
+        <RollingRandomAccessFile name="paodingAppender" fileName="${logFileRoot}/${service}-paoding.log"
+                                 filePattern="${logFileRoot}/bk/${service}-paoding-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout>
+                <Pattern>${pattern}</Pattern>
+            </PatternLayout>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
+            </Policies>
+        </RollingRandomAccessFile>
+        <RollingRandomAccessFile name="passportAppender" fileName="${logFileRoot}/${service}-passport.log"
+                                 filePattern="${logFileRoot}/bk/${service}-passport-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout>
+                <Pattern>${pattern}</Pattern>
+            </PatternLayout>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
+            </Policies>
+        </RollingRandomAccessFile>
+        <RollingRandomAccessFile name="rootAppender" fileName="${logFileRoot}/${service}-root.log"
+                                 filePattern="${logFileRoot}/bk/${service}-root-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout>
+                <Pattern>${pattern}</Pattern>
+            </PatternLayout>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
+            </Policies>
+        </RollingRandomAccessFile>
+        <RollingFile name="XLOGGER_SELF_APPENDER" fileName="${logFileRoot}/xlogger-self.log"
+                     filePattern="${logFileRoot}/bk/xlogger-self-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout>
+                <pattern>${pattern}</pattern>
+            </PatternLayout>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
+                <SizeBasedTriggeringPolicy size="100MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="10"/>
+        </RollingFile>
+        <RollingFile name="trace-log" fileName="${logFileRoot}/xlogger-trace.log"
+                     filePattern="${logFileRoot}/bk/xlogger-trace-%d{yyyy-MM-dd}-%i.log.gz">
+            <PatternLayout>
+                <pattern>${pattern}</pattern>
+            </PatternLayout>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
+            </Policies>
+        </RollingFile>
+        <ScribeXLogger name="Scribe" cluster="${xlogger-cluster}" blockWhenBufferFull="false" />
+    </Appenders>
+    <Loggers>
+        <AsyncLogger name="com.xxx.vip" level="${log4j_level}" additivity="false">

Review comment:
       I suggest that we can use the following logger alone to replace all, thanks.
       <Root level="error">
         <AppenderRef ref="Console"/>
       </Root>




-- 
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: dev-unsubscribe@mnemonic.apache.org

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