File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ <configuration >
2
+ <!-- configure nicer logs for tests:
3
+
4
+ spring boot default format:
5
+ > 2023-10-19T12:33:32.067+02:00 INFO 950066 - - - [ main] o.s.b.t.m.w.SpringBootMockServletContext : Initializing Spring TestDispatcherServlet ''
6
+
7
+ this conf format:
8
+ > 12:49:58.755 [main] INFO org.springframework.boot.test.mock.web.SpringBootMockServletContext - Initializing Spring TestDispatcherServlet ''
9
+
10
+ I guess they chose a very tabular format and show dates and PID because for
11
+ log files on servers it's useful, but not so for tests..
12
+
13
+ also the format changes midtest (before and after the springboot banner) when springboot
14
+ configures the loggers so it's not coherent:
15
+
16
+ spring boot default:
17
+ > 09:24:26.018 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration
18
+ > :: Spring Boot :: (v3.1.2)
19
+ > 2023-10-20T09:26:57.664+02:00 INFO 1026967 - - - [ main] o.s.b.t.m.w.SpringBootMockServletContext : Initializing Spring TestDispatcherServlet ''
20
+
21
+ this conf (uses the same pattern all the time as the initial one in the default springboot conf):
22
+ > 09:32:28.415 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration
23
+ > :: Spring Boot :: (v3.1.2)
24
+ > 09:32:45.146 [main] INFO org.springframework.boot.test.mock.web.SpringBootMockServletContext - Initializing Spring TestDispatcherServlet ''
25
+
26
+ TODO: is there a better way to do this ? Or should sprinboot test do this themselves??
27
+ -->
28
+ <appender name =" STDOUT" class =" ch.qos.logback.core.ConsoleAppender" >
29
+ <encoder >
30
+ <pattern >%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
31
+ </pattern >
32
+ </encoder >
33
+ </appender >
34
+ <root level =" info" >
35
+ <appender-ref ref =" STDOUT" />
36
+ </root >
37
+
38
+ </configuration >
You can’t perform that action at this time.
0 commit comments