Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

Commit 688acac

Browse files
committed
Fix basic logging
1 parent d078488 commit 688acac

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

samples/service-provider/starter/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ dependencies {
5353
compile "org.bouncycastle:bcpkix-jdk15on:$bcprovVersion"
5454
compile "joda-time:joda-time:$jodaTimeVersion"
5555
compile "org.apache.httpcomponents:httpclient:$httpClientVersion"
56-
compile "org.slf4j:slf4j-api:$slf4jVersion"
5756
compile "commons-logging:commons-logging:$commonsLoggingVersion"
5857

5958
//---Spring Security Servlet --
@@ -69,12 +68,13 @@ dependencies {
6968
}
7069
compile "org.thymeleaf.extras:thymeleaf-extras-springsecurity5:$thymeleafExtrasSpringSecurityVersion"
7170

71+
//---Logging --
72+
compile "org.slf4j:slf4j-log4j12:$slf4jVersion"
7273

7374

7475
testCompile ("org.springframework:spring-test:$springVersion") {
7576
exclude group: "commons-logging", module: "commons-logging"
7677
}
77-
testCompile "org.slf4j:slf4j-log4j12:$slf4jVersion"
7878
testCompile "commons-logging:commons-logging:$commonsLoggingVersion"
7979
testCompile ("org.springframework:spring-test:$springVersion") {
8080
exclude group: "commons-logging", module: "commons-logging"
@@ -91,4 +91,4 @@ dependencies {
9191
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.12")
9292

9393

94-
}
94+
}

samples/service-provider/starter/src/main/java/sample/Saml2ServiceProviderStarterApplication.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@
2121
import org.springframework.context.annotation.Import;
2222

2323
import boot.saml2.config.Saml2SampleBootConfiguration;
24+
import org.apache.commons.logging.Log;
25+
import org.apache.commons.logging.LogFactory;
2426

2527
@SpringBootApplication
2628
@Import({ Saml2SampleBootConfiguration.class })
2729
public class Saml2ServiceProviderStarterApplication {
2830

2931
public static void main(String[] args) {
30-
SpringApplication.run(Saml2ServiceProviderStarterApplication.class, args);
32+
Log log = LogFactory.getLog(Saml2ServiceProviderStarterApplication.class);
33+
log.info("Starting SAML 2 Sample Application");
34+
SpringApplication.run(
35+
Saml2ServiceProviderStarterApplication.class, args
36+
);
3137
}
3238

3339
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
# Copyright 2002-2019 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
#
17+
18+
log4j.rootLogger=INFO, consoleAppender
19+
20+
log4j.appender.consoleAppender=org.apache.log4j.ConsoleAppender
21+
log4j.appender.consoleAppender.layout=org.apache.log4j.PatternLayout
22+
log4j.appender.consoleAppender.layout.ConversionPattern=[%t] %-5p %c %x - %m%n

0 commit comments

Comments
 (0)