Skip to content

Commit

Permalink
Merge pull request #155 from NipunaRanasinghe/2201.3.x
Browse files Browse the repository at this point in the history
Replace log4j with slf4j and avoid packing the logging artficats into the native jar
  • Loading branch information
LakshanSS authored May 4, 2023
2 parents 6219ff9 + d825e5f commit 122b903
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
3 changes: 1 addition & 2 deletions asb-ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ modules = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.0.6"
version = "1.0.7"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand Down Expand Up @@ -117,4 +117,3 @@ modules = [
{org = "ballerinax", packageName = "asb", moduleName = "asb"}
]


3 changes: 1 addition & 2 deletions asb-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ repositories {
dependencies {
implementation 'com.azure:azure-messaging-servicebus:7.13.1'
dist group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.13.4'
implementation group: 'log4j', name: 'log4j', version: '1.2.17'
dist group: 'log4j', name: 'log4j', version: '1.2.17'
implementation group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.30'
compile group: 'org.ballerinalang', name: 'ballerina-lang', version: project.ballerinaLangVersion
compile(group: 'org.ballerinalang', name: 'ballerina-runtime', version: project.ballerinaLangVersion) {
transitive = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
import java.util.Objects;
import java.util.UUID;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.qpid.proton.amqp.Binary;
import org.ballerinax.asb.util.ASBConstants;
import org.ballerinax.asb.util.ASBUtils;
import org.ballerinax.asb.util.ModuleUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.ballerinax.asb.util.ASBConstants.RECEIVE_AND_DELETE;
import static org.ballerinax.asb.util.ASBUtils.getRetryOptions;
Expand All @@ -66,7 +66,7 @@
* Ballerina.
*/
public class MessageReceiver {
private static final Logger log = Logger.getLogger(MessageReceiver.class);
private static final Logger log = LoggerFactory.getLogger(MessageReceiver.class);
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private ServiceBusReceiverClient receiver;

Expand All @@ -88,7 +88,6 @@ public class MessageReceiver {
public MessageReceiver(String connectionString, String queueName, String topicName, String subscriptionName,
String receiveMode, long maxAutoLockRenewDuration, String logLevel, BMap<BString, Object> retryConfigs)
throws ServiceBusException, InterruptedException {
log.setLevel(Level.toLevel(logLevel, Level.OFF));
AmqpRetryOptions retryOptions = getRetryOptions(retryConfigs);
ServiceBusReceiverClientBuilder receiverClientBuilder = new ServiceBusClientBuilder()
.connectionString(connectionString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@
import java.util.Collection;
import java.util.Map;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.ballerinax.asb.util.ASBConstants;
import org.ballerinax.asb.util.ASBUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.ballerinax.asb.util.ASBUtils.getRetryOptions;

/**
* This facilitates the client operations of MessageSender client in Ballerina.
*/
public class MessageSender {
private static final Logger log = Logger.getLogger(MessageSender.class);
private static final Logger log = LoggerFactory.getLogger(MessageSender.class);
private ServiceBusSenderClient sender;

/**
Expand All @@ -69,7 +69,6 @@ public class MessageSender {
public MessageSender(String connectionString, String entityType, String topicOrQueueName, String logLevel,
BMap<BString, Object> retryConfigs)
throws ServiceBusException, InterruptedException {
log.setLevel(Level.toLevel(logLevel, Level.OFF));
AmqpRetryOptions retryOptions = getRetryOptions(retryConfigs);
ServiceBusClientBuilder clientBuilder = new ServiceBusClientBuilder()
.retryOptions(retryOptions)
Expand Down

0 comments on commit 122b903

Please sign in to comment.