|
1 | 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 | + --> |
2 | 28 | <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
3 | 29 | <encoder>
|
4 | 30 | <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
|
|
9 | 35 | <appender-ref ref="STDOUT"/>
|
10 | 36 | </root>
|
11 | 37 | <!--
|
12 |
| - suppress unreadable huge logs.. |
| 38 | + our logs |
13 | 39 | -->
|
14 |
| - <logger name="org.springframework.test" level="warn"/> |
15 |
| - <logger name="org.springframework.boot.test" level="warn"/> |
16 | 40 | <logger name="org.gridsuite.useradmin.server" level="trace"/>
|
17 | 41 |
|
18 | 42 | </configuration>
|
0 commit comments