Skip to content

Commit

Permalink
remove log4j1 usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tharindu1st committed Jan 13, 2022
1 parent 9c48e0a commit cd6af38
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 22 deletions.
Expand Up @@ -39,10 +39,7 @@
<groupId>org.wso2.orbit.org.eclipse.jetty</groupId>
<artifactId>jetty-bundle</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>

<dependency>
<groupId>org.wso2.carbon.mediation</groupId>
<artifactId>org.wso2.carbon.inbound</artifactId>
Expand Down
Expand Up @@ -20,7 +20,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC;
import org.apache.logging.log4j.ThreadContext;
import org.apache.synapse.commons.CorrelationConstants;
import org.apache.synapse.transport.passthru.PassThroughConstants;
import org.apache.synapse.transport.passthru.SourceRequest;
Expand Down Expand Up @@ -50,8 +50,8 @@ public class InboundCorrelationEnabledHttpServerWorker extends InboundHttpServer
@Override
public void run() {
// Reset the correlation id MDC thread local value.
MDC.remove(CorrelationConstants.CORRELATION_MDC_PROPERTY);
MDC.put(CorrelationConstants.CORRELATION_MDC_PROPERTY, correlationId);
ThreadContext.remove(CorrelationConstants.CORRELATION_MDC_PROPERTY);
ThreadContext.put(CorrelationConstants.CORRELATION_MDC_PROPERTY, correlationId);
// Log the time taken to switch from the previous thread to this thread
correlationLog.info((System.currentTimeMillis() - initiationTimestamp) + "|Thread switch latency");
super.run();
Expand Down
Expand Up @@ -19,9 +19,9 @@
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
import io.netty.handler.codec.http.websocketx.WebSocketFrame;
import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
import org.apache.axiom.om.OMOutputFormat;
import org.apache.axis2.AxisFault;
import org.apache.axis2.transport.MessageFormatter;
Expand All @@ -30,7 +30,6 @@
import org.apache.commons.io.output.WriterOutputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Logger;
import org.apache.synapse.MessageContext;
import org.apache.synapse.core.axis2.Axis2MessageContext;
import org.apache.synapse.inbound.InboundResponseSender;
Expand All @@ -39,7 +38,6 @@
import org.wso2.carbon.inbound.endpoint.protocol.websocket.management.WebsocketSubscriberPathManager;

import javax.xml.stream.XMLStreamException;

import java.io.IOException;
import java.io.OutputStream;
import java.io.StringWriter;
Expand Down
4 changes: 4 additions & 0 deletions components/inbound-endpoints/pom.xml
Expand Up @@ -80,6 +80,10 @@
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down
1 change: 0 additions & 1 deletion components/mediation-admin/org.wso2.carbon.inbound/pom.xml
Expand Up @@ -80,7 +80,6 @@
org.apache.axis2.*; version="${axis2.osgi.version.range}",
org.apache.axiom.*; version="${axiom.osgi.version.range}",
org.apache.commons.logging.*; version="${import.package.version.commons.logging}",
org.apache.log4j.*,
org.apache.commons.collections.*,
org.apache.synapse.commons.*,
org.apache.synapse.task.*,
Expand Down
Expand Up @@ -78,7 +78,6 @@
org.apache.axis2.*; version="${axis2.osgi.version.range}",
org.apache.axiom.*; version="${axis2.osgi.version.range}",
org.apache.commons.logging.*; version="${import.package.version.commons.logging}",
org.apache.log4j.*,
org.apache.commons.collections.*,
org.apache.synapse.commons.*,
org.apache.synapse.task.*,
Expand Down
1 change: 0 additions & 1 deletion components/mediation-admin/org.wso2.carbon.task/pom.xml
Expand Up @@ -90,7 +90,6 @@
org.apache.axis2.*; version="${axis2.osgi.version.range}",
org.apache.axiom.*; version="${axiom.osgi.version.range}",
org.apache.commons.logging.*; version="${import.package.version.commons.logging}",
org.apache.log4j.*,
org.apache.commons.collections.*,
org.apache.synapse.commons.*,
org.apache.synapse.task.*,
Expand Down
Expand Up @@ -85,10 +85,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>org.apache.synapse</groupId>
<artifactId>synapse-core</artifactId>
Expand Down
Expand Up @@ -87,10 +87,7 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>

<!-- carbon core dependency -->
<dependency>
<groupId>org.wso2.carbon</groupId>
Expand Down
8 changes: 7 additions & 1 deletion pom.xml
Expand Up @@ -599,6 +599,12 @@
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.stream.core</artifactId>
<version>${carbon.analytics.common.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.log4j.wso2</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.commons</groupId>
Expand Down Expand Up @@ -2406,7 +2412,7 @@
<carbon.rule.version>4.5.6</carbon.rule.version>
<carbon.rule.imp.pkg.version>[4.5.0, 4.6.0)</carbon.rule.imp.pkg.version>
<!-- Synapse Version -->
<synapse.version>2.1.7-wso2v241</synapse.version>
<synapse.version>2.1.7-wso2v243</synapse.version>
<carbon.identity.entitlement.proxy.version>5.3.4</carbon.identity.entitlement.proxy.version>
<carbon.identity.entitlement.proxy.imp.pkg.version>[5.2.0, 6.0.0)
</carbon.identity.entitlement.proxy.imp.pkg.version>
Expand Down

0 comments on commit cd6af38

Please sign in to comment.