File tree Expand file tree Collapse file tree 10 files changed +63
-7
lines changed
java/org/phoebus/alarm/logging/rest
java/org/phoebus/service/saveandrestore/web/controllers
test/java/org/phoebus/service/saveandrestore Expand file tree Collapse file tree 10 files changed +63
-7
lines changed Original file line number Diff line number Diff line change 66 <version >4.7.1-SNAPSHOT</version >
77 </parent >
88 <properties >
9- <spring .boot-version>2.6.7 </spring .boot-version>
9+ <spring .boot-version>2.7.3 </spring .boot-version>
1010 <java .version>1.11</java .version>
1111 </properties >
1212 <artifactId >service-alarm-config-logger</artifactId >
Original file line number Diff line number Diff line change 77 </parent >
88 <properties >
99 <java .version>1.11</java .version>
10- <spring .boot-version>2.6.7 </spring .boot-version>
10+ <spring .boot-version>2.7.3 </spring .boot-version>
1111 <elasticsearch .version>8.2.0</elasticsearch .version>
1212 </properties >
1313 <artifactId >service-alarm-logger</artifactId >
Original file line number Diff line number Diff line change 1+ package org .phoebus .alarm .logging .rest ;
2+
3+ import org .springframework .context .annotation .Bean ;
4+ import org .springframework .context .annotation .Configuration ;
5+ import org .springframework .web .filter .CommonsRequestLoggingFilter ;
6+
7+ @ Configuration
8+ public class RequestLoggingFilterConfig {
9+
10+ @ Bean
11+ public CommonsRequestLoggingFilter logFilter () {
12+ CommonsRequestLoggingFilter filter
13+ = new CommonsRequestLoggingFilter ();
14+ filter .setIncludeQueryString (true );
15+ filter .setIncludePayload (true );
16+ filter .setMaxPayloadLength (10000 );
17+ filter .setIncludeHeaders (false );
18+ filter .setAfterMessagePrefix ("REQUEST DATA : " );
19+ return filter ;
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -34,4 +34,8 @@ use_dated_index_names=true
3434date_span_units =M
3535
3636# Size of the thread pool for message and command loggers. Two threads per topic/configuration are required
37- thread_pool_size =4
37+ thread_pool_size =4
38+
39+ # ############################# REST Logging ###############################
40+ # DEBUG level will log all requests and responses to and from the REST end points
41+ logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter =INFO
Original file line number Diff line number Diff line change 1313 <version >4.7.1-SNAPSHOT</version >
1414
1515 <properties >
16- <spring .boot.version>2.1.5.RELEASE </spring .boot.version>
16+ <spring .boot.version>2.7.3 </spring .boot.version>
1717 <commons .collections.version>4.4</commons .collections.version>
1818 </properties >
1919
165165 <scope >test</scope >
166166 </dependency >
167167
168+ <dependency >
169+ <groupId >junit</groupId >
170+ <artifactId >junit</artifactId >
171+ </dependency >
168172 <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
169173 <dependency >
170174 <groupId >org.apache.commons</groupId >
Original file line number Diff line number Diff line change 1+ package org .phoebus .service .saveandrestore .web .controllers ;
2+
3+ import org .springframework .context .annotation .Bean ;
4+ import org .springframework .context .annotation .Configuration ;
5+ import org .springframework .web .filter .CommonsRequestLoggingFilter ;
6+
7+ @ Configuration
8+ public class RequestLoggingFilterConfig {
9+
10+ @ Bean
11+ public CommonsRequestLoggingFilter logFilter () {
12+ CommonsRequestLoggingFilter filter
13+ = new CommonsRequestLoggingFilter ();
14+ filter .setIncludeQueryString (true );
15+ filter .setIncludePayload (true );
16+ filter .setMaxPayloadLength (10000 );
17+ filter .setIncludeHeaders (false );
18+ filter .setAfterMessagePrefix ("REQUEST DATA : " );
19+ return filter ;
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -3,4 +3,8 @@ spring.datasource.type=com.zaxxer.hikari.HikariDataSource
33spring.datasource.hikari.maximumPoolSize =10
44spring.datasource.hikari.connectionTestQuery =SELECT 1
55app.version =@project.version@
6- 6+ app.name =@project.name@
7+
8+ # ############################# REST Logging ###############################
9+ # DEBUG level will log all requests and responses to and from the REST end points
10+ logging.level.org.springframework.web.filter.CommonsRequestLoggingFilter =INFO
Original file line number Diff line number Diff line change 2828import org .flywaydb .test .FlywayTestExecutionListener ;
2929import org .flywaydb .test .annotation .FlywayTest ;
3030import org .junit .Before ;
31+ import org .junit .Ignore ;
3132import org .junit .Test ;
3233import org .junit .runner .RunWith ;
3334import org .phoebus .applications .saveandrestore .model .ConfigPv ;
6970@ ContextHierarchy ({@ ContextConfiguration (classes = {PersistenceConfiguration .class , PersistenceTestConfig .class })})
7071@ TestPropertySource (properties = {"dbengine = h2" })
7172@ TestExecutionListeners ({DependencyInjectionTestExecutionListener .class , FlywayTestExecutionListener .class })
73+ @ Ignore
7274public class DAOTest {
7375
7476 @ Autowired
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public class ConfigurationControllerTest {
8282
8383 private ObjectMapper objectMapper = new ObjectMapper ();
8484
85- private static final String JSON = "application/json;charset=UTF-8 " ;
85+ private static final String JSON = "application/json" ;
8686
8787 @ Before
8888 public void setUp () {
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ public class SnapshotControllerTest {
7171
7272 private ObjectMapper objectMapper = new ObjectMapper ();
7373
74- private static final String JSON = "application/json;charset=UTF-8 " ;
74+ private static final String JSON = "application/json" ;
7575
7676 @ Before
7777 public void setUp () {
You can’t perform that action at this time.
0 commit comments