[jira] [Commented] (ROCKETMQ-359) Replace slf4j api used in RocketMQ with InternalLogger

2018-03-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16389111#comment-16389111
 ] 

ASF GitHub Bot commented on ROCKETMQ-359:
-

zhouxinyu commented on issue #221: [ROCKETMQ-359] Replace slf4j api used in 
RocketMQ with InternalLogger
URL: https://github.com/apache/rocketmq/pull/221#issuecomment-371037247
 
 
   Merged thanks.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Replace slf4j api used in RocketMQ with InternalLogger
> --
>
> Key: ROCKETMQ-359
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-359
> Project: Apache RocketMQ
>  Issue Type: Improvement
>Affects Versions: 4.2.0
>Reporter: lindzh
>Assignee: vongosling
>Priority: Major
> Fix For: 4.3.0
>
>
> Since Logger is used any where and there is many loggers for us to choose,In 
> many cases we have to isolate our logger with other loggers. In my opinion 
> use an isolated logger is necessary.
> - logging isolation has been fix with logging 
> component
> And it is necessary to replace slf4j api used in RocketMQ with InternalLogger 
> now!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ROCKETMQ-359) Replace slf4j api used in RocketMQ with InternalLogger

2018-03-06 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1637#comment-1637
 ] 

ASF GitHub Bot commented on ROCKETMQ-359:
-

lindzh commented on a change in pull request #221: [ROCKETMQ-359] Replace slf4j 
api used in RocketMQ with InternalLogger
URL: https://github.com/apache/rocketmq/pull/221#discussion_r172721498
 
 

 ##
 File path: 
remoting/src/main/java/org/apache/rocketmq/remoting/common/ServiceThread.java
 ##
 @@ -16,14 +16,15 @@
  */
 package org.apache.rocketmq.remoting.common;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.apache.rocketmq.logging.InternalLogger;
 
 Review comment:
   Yes


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Replace slf4j api used in RocketMQ with InternalLogger
> --
>
> Key: ROCKETMQ-359
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-359
> Project: Apache RocketMQ
>  Issue Type: Improvement
>Affects Versions: 4.2.0
>Reporter: lindzh
>Assignee: vongosling
>Priority: Major
> Fix For: 4.3.0
>
>
> Since Logger is used any where and there is many loggers for us to choose,In 
> many cases we have to isolate our logger with other loggers. In my opinion 
> use an isolated logger is necessary.
> - logging isolation has been fix with logging 
> component
> And it is necessary to replace slf4j api used in RocketMQ with InternalLogger 
> now!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ROCKETMQ-359) Replace slf4j api used in RocketMQ with InternalLogger

2018-03-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16387389#comment-16387389
 ] 

ASF GitHub Bot commented on ROCKETMQ-359:
-

vongosling commented on a change in pull request #221: [ROCKETMQ-359] Replace 
slf4j api used in RocketMQ with InternalLogger
URL: https://github.com/apache/rocketmq/pull/221#discussion_r172425109
 
 

 ##
 File path: 
remoting/src/main/java/org/apache/rocketmq/remoting/common/ServiceThread.java
 ##
 @@ -16,14 +16,15 @@
  */
 package org.apache.rocketmq.remoting.common;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import org.apache.rocketmq.logging.InternalLogger;
 
 Review comment:
   Manual replace?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Replace slf4j api used in RocketMQ with InternalLogger
> --
>
> Key: ROCKETMQ-359
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-359
> Project: Apache RocketMQ
>  Issue Type: Improvement
>Affects Versions: 4.2.0
>Reporter: lindzh
>Assignee: vongosling
>Priority: Major
> Fix For: 4.3.0
>
>
> Since Logger is used any where and there is many loggers for us to choose,In 
> many cases we have to isolate our logger with other loggers. In my opinion 
> use an isolated logger is necessary.
> - logging isolation has been fix with logging 
> component
> And it is necessary to replace slf4j api used in RocketMQ with InternalLogger 
> now!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ROCKETMQ-359) Replace slf4j api used in RocketMQ with InternalLogger

2018-03-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383517#comment-16383517
 ] 

ASF GitHub Bot commented on ROCKETMQ-359:
-

coveralls commented on issue #221: [ROCKETMQ-359] Replace slf4j api used in 
RocketMQ with InternalLogger
URL: https://github.com/apache/rocketmq/pull/221#issuecomment-359795067
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/15775789/badge)](https://coveralls.io/builds/15775789)
   
   Coverage decreased (-0.2%) to 41.005% when pulling 
**9218f41044ebec85d74ac84c1db42cad384fde0c on lindzh:fix_client_log_full** into 
**c19fa25c87d6f6a7e5af7eab99910c271173225f on apache:develop**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Replace slf4j api used in RocketMQ with InternalLogger
> --
>
> Key: ROCKETMQ-359
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-359
> Project: Apache RocketMQ
>  Issue Type: Improvement
>Affects Versions: 4.2.0
>Reporter: lindzh
>Assignee: vongosling
>Priority: Major
> Fix For: 4.3.0
>
>
> Since Logger is used any where and there is many loggers for us to choose,In 
> many cases we have to isolate our logger with other loggers. In my opinion 
> use an isolated logger is necessary.
> - logging isolation has been fix with logging 
> component
> And it is necessary to replace slf4j api used in RocketMQ with InternalLogger 
> now!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ROCKETMQ-359) Replace slf4j api used in RocketMQ with InternalLogger

2018-03-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383489#comment-16383489
 ] 

ASF GitHub Bot commented on ROCKETMQ-359:
-

lindzh commented on a change in pull request #221: [ROCKETMQ-359] Replace slf4j 
api used in RocketMQ with InternalLogger
URL: https://github.com/apache/rocketmq/pull/221#discussion_r171825186
 
 

 ##
 File path: 
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyLogger.java
 ##
 @@ -0,0 +1,316 @@
+/*
+ * 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.
+ */
+
+package org.apache.rocketmq.remoting.netty;
+
+
+import io.netty.util.internal.logging.InternalLogLevel;
+import org.apache.rocketmq.logging.InternalLogger;
+import org.apache.rocketmq.logging.InternalLoggerFactory;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class NettyLogger {
+
+private static AtomicBoolean nettyLoggerSeted = new AtomicBoolean(false);
+
+private static InternalLogLevel nettyLogLevel = InternalLogLevel.ERROR;
+
+public static void initNettyLogger() {
+if (!nettyLoggerSeted.get()) {
+try {
+
io.netty.util.internal.logging.InternalLoggerFactory.setDefaultFactory(new 
NettyBridgeLoggerFactory());
+} catch (Throwable e) {
+//ignore
+}
+nettyLoggerSeted.set(true);
+}
+}
+
+private static class NettyBridgeLoggerFactory extends 
io.netty.util.internal.logging.InternalLoggerFactory {
+@Override
+protected io.netty.util.internal.logging.InternalLogger 
newInstance(String s) {
+return new NettyBridgeLogger(s);
+}
+}
+
+private static class NettyBridgeLogger implements 
io.netty.util.internal.logging.InternalLogger {
+
+private InternalLogger logger = null;
+
+public NettyBridgeLogger(String name) {
+logger = InternalLoggerFactory.getLogger(name);
+}
+
+@Override
+public String name() {
+return logger.getName();
+}
+
+// FIXME: 2018/3/2 
 
 Review comment:
   Fixme has been deleted.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Replace slf4j api used in RocketMQ with InternalLogger
> --
>
> Key: ROCKETMQ-359
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-359
> Project: Apache RocketMQ
>  Issue Type: Improvement
>Affects Versions: 4.2.0
>Reporter: lindzh
>Assignee: vongosling
>Priority: Major
> Fix For: 4.3.0
>
>
> Since Logger is used any where and there is many loggers for us to choose,In 
> many cases we have to isolate our logger with other loggers. In my opinion 
> use an isolated logger is necessary.
> - logging isolation has been fix with logging 
> component
> And it is necessary to replace slf4j api used in RocketMQ with InternalLogger 
> now!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ROCKETMQ-359) Replace slf4j api used in RocketMQ with InternalLogger

2018-03-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383486#comment-16383486
 ] 

ASF GitHub Bot commented on ROCKETMQ-359:
-

lindzh commented on a change in pull request #221: [ROCKETMQ-359] Replace slf4j 
api used in RocketMQ with InternalLogger
URL: https://github.com/apache/rocketmq/pull/221#discussion_r171824821
 
 

 ##
 File path: 
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyLogger.java
 ##
 @@ -0,0 +1,316 @@
+/*
+ * 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.
+ */
+
+package org.apache.rocketmq.remoting.netty;
+
+
+import io.netty.util.internal.logging.InternalLogLevel;
+import org.apache.rocketmq.logging.InternalLogger;
+import org.apache.rocketmq.logging.InternalLoggerFactory;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class NettyLogger {
+
+private static AtomicBoolean nettyLoggerSeted = new AtomicBoolean(false);
+
+private static InternalLogLevel nettyLogLevel = InternalLogLevel.ERROR;
+
+public static void initNettyLogger() {
+if (!nettyLoggerSeted.get()) {
+try {
+
io.netty.util.internal.logging.InternalLoggerFactory.setDefaultFactory(new 
NettyBridgeLoggerFactory());
+} catch (Throwable e) {
+//ignore
+}
+nettyLoggerSeted.set(true);
+}
+}
+
+private static class NettyBridgeLoggerFactory extends 
io.netty.util.internal.logging.InternalLoggerFactory {
+@Override
+protected io.netty.util.internal.logging.InternalLogger 
newInstance(String s) {
+return new NettyBridgeLogger(s);
+}
+}
+
+private static class NettyBridgeLogger implements 
io.netty.util.internal.logging.InternalLogger {
+
+private InternalLogger logger = null;
+
+public NettyBridgeLogger(String name) {
+logger = InternalLoggerFactory.getLogger(name);
+}
+
+@Override
+public String name() {
+return logger.getName();
+}
+
+// FIXME: 2018/3/2 
 
 Review comment:
   Netty Logger has been hard coded to use ERROR log level.  I think this is 
not a good idea.  I hope to fix this in next PR. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Replace slf4j api used in RocketMQ with InternalLogger
> --
>
> Key: ROCKETMQ-359
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-359
> Project: Apache RocketMQ
>  Issue Type: Improvement
>Affects Versions: 4.2.0
>Reporter: lindzh
>Assignee: vongosling
>Priority: Major
> Fix For: 4.3.0
>
>
> Since Logger is used any where and there is many loggers for us to choose,In 
> many cases we have to isolate our logger with other loggers. In my opinion 
> use an isolated logger is necessary.
> - logging isolation has been fix with logging 
> component
> And it is necessary to replace slf4j api used in RocketMQ with InternalLogger 
> now!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)