Fix custom log printing issue

apim420
Lasantha Dharmakeerthi 10 months ago
commit 00d79ae6d9

@ -131,7 +131,6 @@
<groupId>org.ops4j.pax.logging</groupId> <groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId> <artifactId>pax-logging-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId> <groupId>org.wso2.carbon.identity.inbound.auth.oauth2</groupId>

@ -55,7 +55,6 @@
<groupId>org.ops4j.pax.logging</groupId> <groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId> <artifactId>pax-logging-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon.apimgt</groupId> <groupId>org.wso2.carbon.apimgt</groupId>

@ -158,7 +158,6 @@
<groupId>org.ops4j.pax.logging</groupId> <groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId> <artifactId>pax-logging-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>

@ -62,7 +62,6 @@
<groupId>org.ops4j.pax.logging</groupId> <groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId> <artifactId>pax-logging-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon</groupId> <groupId>org.wso2.carbon</groupId>

@ -35,7 +35,7 @@
<dependency> <dependency>
<groupId>org.ops4j.pax.logging</groupId> <groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId> <artifactId>pax-logging-api</artifactId>
<scope>provided</scope> <!-- <scope>provided</scope>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.testng</groupId> <groupId>org.testng</groupId>
@ -45,6 +45,11 @@
<groupId>io.entgra.device.mgt.core</groupId> <groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.device.mgt.extensions.logger</artifactId> <artifactId>io.entgra.device.mgt.core.device.mgt.extensions.logger</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-ext</artifactId>
<version>1.7.29</version>
</dependency>
</dependencies> </dependencies>
<properties> <properties>
@ -58,7 +63,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<!-- <version>3.8.1</version>-->
<configuration> <configuration>
<source>1.8</source> <source>1.8</source>
<target>1.8</target> <target>1.8</target>
@ -75,12 +79,13 @@
<Bundle-Version>${io.entgra.device.mgt.core.version}</Bundle-Version> <Bundle-Version>${io.entgra.device.mgt.core.version}</Bundle-Version>
<Bundle-Description>Device Notification Logger Bundle</Bundle-Description> <Bundle-Description>Device Notification Logger Bundle</Bundle-Description>
<Import-Package> <Import-Package>
io.entgra.device.mgt.core.device.mgt.extensions.logger;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.extensions.logger.spi;version="[5.0,6)",
io.entgra.device.mgt.core.notification.logger, io.entgra.device.mgt.core.notification.logger,
io.entgra.device.mgt.core.notification.logger.util, io.entgra.device.mgt.core.notification.logger.util,
io.entgra.device.mgt.core.device.mgt.extensions.logger;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.extensions.logger.spi;version="[5.0,6)",
org.slf4j,
org.slf4j.ext,
org.apache.commons.logging;version="[1.2,2)" org.apache.commons.logging;version="[1.2,2)"
<!-- org.apache.log4j;version="[2,3)"-->
</Import-Package> </Import-Package>
<Export-Package> <Export-Package>
io.entgra.device.mgt.core.notification.logger.* io.entgra.device.mgt.core.notification.logger.*
@ -90,5 +95,4 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

@ -23,7 +23,8 @@ import io.entgra.device.mgt.core.notification.logger.AppInstallLogContext;
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil; import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC; import org.slf4j.MDC;
public class EntgraAppInstallLoggerImpl implements EntgraLogger { public class EntgraAppInstallLoggerImpl implements EntgraLogger {

@ -23,7 +23,8 @@ import io.entgra.device.mgt.core.notification.logger.DeviceConnectivityLogContex
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil; import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC; import org.slf4j.MDC;
public class EntgraDeviceConnectivityLoggerImpl implements EntgraLogger { public class EntgraDeviceConnectivityLoggerImpl implements EntgraLogger {

@ -23,7 +23,8 @@ import io.entgra.device.mgt.core.notification.logger.DeviceEnrolmentLogContext;
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil; import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC; import org.slf4j.MDC;
public class EntgraDeviceEnrolmentLoggerImpl implements EntgraLogger { public class EntgraDeviceEnrolmentLoggerImpl implements EntgraLogger {

@ -23,7 +23,8 @@ import io.entgra.device.mgt.core.notification.logger.DeviceLogContext;
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil; import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC; import org.slf4j.MDC;
public class EntgraDeviceLoggerImpl implements EntgraLogger { public class EntgraDeviceLoggerImpl implements EntgraLogger {

@ -23,7 +23,8 @@ import io.entgra.device.mgt.core.notification.logger.GroupMgtLogContext;
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil; import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC; import org.slf4j.MDC;
public class EntgraGroupMgtLoggerImpl implements EntgraLogger { public class EntgraGroupMgtLoggerImpl implements EntgraLogger {

@ -23,7 +23,8 @@ import io.entgra.device.mgt.core.notification.logger.PolicyLogContext;
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil; import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC; import org.slf4j.MDC;
public class EntgraPolicyLoggerImpl implements EntgraLogger { public class EntgraPolicyLoggerImpl implements EntgraLogger {

@ -23,7 +23,8 @@ import io.entgra.device.mgt.core.notification.logger.RoleMgtLogContext;
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil; import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC; import org.slf4j.MDC;
public class EntgraRoleMgtLoggerImpl implements EntgraLogger { public class EntgraRoleMgtLoggerImpl implements EntgraLogger {

@ -23,7 +23,7 @@ import io.entgra.device.mgt.core.notification.logger.UserLoginLogContext;
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil; import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC; import org.slf4j.MDC;
public class EntgraUserLoginLoggerImpl implements EntgraLogger { public class EntgraUserLoginLoggerImpl implements EntgraLogger {

@ -23,7 +23,8 @@ import io.entgra.device.mgt.core.notification.logger.UserMgtLogContext;
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil; import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC; import org.slf4j.MDC;
public class EntgraUserMgtLoggerImpl implements EntgraLogger { public class EntgraUserMgtLoggerImpl implements EntgraLogger {

@ -18,8 +18,8 @@
package io.entgra.device.mgt.core.notification.logger.util; package io.entgra.device.mgt.core.notification.logger.util;
import io.entgra.device.mgt.core.notification.logger.*; import io.entgra.device.mgt.core.notification.logger.*;
import org.apache.log4j.MDC; import org.slf4j.MDC;
//
public final class MDCContextUtil { public final class MDCContextUtil {
public static void populateDeviceMDCContext(final DeviceLogContext mdcContext) { public static void populateDeviceMDCContext(final DeviceLogContext mdcContext) {
@ -54,7 +54,7 @@ public final class MDCContextUtil {
MDC.put("IsUserRegistered", "Registered"); MDC.put("IsUserRegistered", "Registered");
} }
if (mdcContext.isDeviceRegistered()) { if (mdcContext.isDeviceRegistered()) {
MDC.put("IsDeviceRegistered", mdcContext.isDeviceRegistered()); MDC.put("IsDeviceRegistered", String.valueOf(mdcContext.isDeviceRegistered()));
} }
if (mdcContext.getTenantDomain() != null) { if (mdcContext.getTenantDomain() != null) {
MDC.put("TenantDomain", mdcContext.getTenantDomain()); MDC.put("TenantDomain", mdcContext.getTenantDomain());

@ -40,7 +40,7 @@
<dependency> <dependency>
<groupId>org.ops4j.pax.logging</groupId> <groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId> <artifactId>pax-logging-api</artifactId>
<scope>provided</scope> <!-- <scope>provided</scope>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.testng</groupId> <groupId>org.testng</groupId>

Loading…
Cancel
Save