Skip to content

Log message for a composed router function contains no information about the mappings or their handlers [SPR-15933] #20487

@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened SPR-15933 and commented

When RouterFunctionMapping logs a message about a composed router function, the message conveys nothing other than something was mapped. This severely limits the messages usefulness.

With a function with a single mapping:

@Bean
public RouterFunction<ServerResponse> foo() {
	return route(GET("/foo"), (request) -> ServerResponse.ok().build());
}

The log message describes the predicates and the target of the mapping:

2017-09-07 12:12:49.758  INFO 46234 --- [           main] o.s.w.r.f.s.s.RouterFunctionMapping      : Mapped (GET && /foo) -> com.example.demo.Gh9979Application$$Lambda$159/1751403001@7fc6de5b

By contrast, with a composed router function:

@Bean
public RouterFunction<ServerResponse> barAndBaz() {
	return route(GET("/bar"), this::emptyOk).and(route(GET("baz"), this::emptyOk));
}

The log message doesn't describe any of the predicates or the targets of the mappings:

2017-09-07 12:12:49.758  INFO 46234 --- [           main] o.s.w.r.f.s.s.RouterFunctionMapping      : Mapped org.springframework.web.reactive.function.server.RouterFunction$$Lambda$163/632475595@fb9c7aa

Would it be possible to capture the information about each individual function that's part of the composed function so that the log message can convey some information about all of the mappings that are involved?


Affects: 5.0 RC3

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions