{"id":8811,"date":"2022-05-11T16:15:27","date_gmt":"2022-05-11T16:15:27","guid":{"rendered":"https:\/\/blogs.aaddevsup.xyz\/?p=8811"},"modified":"2022-05-11T21:29:41","modified_gmt":"2022-05-11T21:29:41","slug":"how-to-enable-msal-for-java-msal4j-logging-in-a-spring-boot-application","status":"publish","type":"post","link":"https:\/\/blogs.aaddevsup.xyz\/2022\/05\/how-to-enable-msal-for-java-msal4j-logging-in-a-spring-boot-application\/","title":{"rendered":"How to enable MSAL for Java (MSAL4J) logging in a Spring Boot application"},"content":{"rendered":"\n
In this blog, I’ll show how to enable MSAL4J<\/a> logging using the logback<\/a> framework in a spring boot web application. I’ll use our Azure AD B2C web sample here<\/a>. The complete code for this blog is on github<\/a>. Refer to the MSAL for Java logging documentation<\/a> for more info. There are 3 main things you need to do for logging to work<\/p>\n\n\n\n 1) Include the logback package in the pom.xml file<\/p>\n\n\n\n 2) Add a file called ‘logback.xml’ with the following content to the resources folder. <\/p>\n\n\n\n\t\t<dependency>\n\t\t\t<groupId>ch.qos.logback<\/groupId>\n\t\t\t<artifactId>logback-classic<\/artifactId>\n\t\t\t<version>1.2.3<\/version>\n\t\t<\/dependency><\/pre>\n\n\n\n