Skip to content

Commit b1edaf9

Browse files
committed
fix: SpringBoot and samples use log4j2
1 parent 13c125d commit b1edaf9

File tree

4 files changed

+51
-10
lines changed

4 files changed

+51
-10
lines changed

samples/spring-boot-3-web/pom.xml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,21 @@
6767
<artifactId>shiro-spring</artifactId>
6868
<classifier>jakarta</classifier>
6969
</dependency>
70+
<dependency>
71+
<groupId>org.apache.logging.log4j</groupId>
72+
<artifactId>log4j-slf4j2-impl</artifactId>
73+
<scope>runtime</scope>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.apache.logging.log4j</groupId>
77+
<artifactId>log4j-api</artifactId>
78+
<scope>runtime</scope>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.apache.logging.log4j</groupId>
82+
<artifactId>log4j-core</artifactId>
83+
<scope>runtime</scope>
84+
</dependency>
7085

7186
<!-- Spring Boot -->
7287
<dependency>
@@ -132,16 +147,6 @@
132147
<artifactId>tomcat-embed-websocket</artifactId>
133148
<version>10.1.49</version>
134149
</dependency>
135-
<dependency>
136-
<groupId>ch.qos.logback</groupId>
137-
<artifactId>logback-classic</artifactId>
138-
<version>1.5.21</version>
139-
</dependency>
140-
<dependency>
141-
<groupId>ch.qos.logback</groupId>
142-
<artifactId>logback-core</artifactId>
143-
<version>1.5.21</version>
144-
</dependency>
145150
</dependencies>
146151
</dependencyManagement>
147152

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
# Root logger configuration
20+
rootLogger.level = info
21+
rootLogger.appenderRef.stdout.ref = STDOUT
22+
23+
# Console appender configuration
24+
appender.stdout.type = Console
25+
appender.stdout.name = STDOUT
26+
appender.stdout.layout.type = PatternLayout
27+
# Use %highlight to add color to the log level and %cyan for the logger name
28+
appender.stdout.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %highlight{%-5level} %cyan{%c{1.}} - %msg%n

support/spring-boot/spring-boot-starter/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
</exclusion>
6060
</exclusions>
6161
</dependency>
62+
<dependency>
63+
<groupId>org.springframework.boot</groupId>
64+
<artifactId>spring-boot-starter-log4j2</artifactId>
65+
</dependency>
6266
<dependency>
6367
<groupId>org.springframework</groupId>
6468
<artifactId>spring-webmvc</artifactId>

support/spring-boot/spring-boot-web-starter/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
</exclusion>
7575
</exclusions>
7676
</dependency>
77+
<dependency>
78+
<groupId>org.springframework.boot</groupId>
79+
<artifactId>spring-boot-starter-log4j2</artifactId>
80+
</dependency>
7781
</dependencies>
7882

7983

0 commit comments

Comments
 (0)