File tree 1 file changed +10
-3
lines changed
spring-web/src/main/java/org/springframework/http/server/reactive
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
19
19
import java .net .InetSocketAddress ;
20
20
import java .net .URI ;
21
21
import java .net .URISyntaxException ;
22
+ import java .util .concurrent .atomic .AtomicLong ;
22
23
23
24
import javax .net .ssl .SSLSession ;
24
25
47
48
*/
48
49
class ReactorServerHttpRequest extends AbstractServerHttpRequest {
49
50
51
+ private static final AtomicLong logPrefixIndex = new AtomicLong (0 );
52
+
53
+
50
54
private final HttpServerRequest request ;
51
55
52
56
private final NettyDataBufferFactory bufferFactory ;
@@ -181,8 +185,11 @@ public <T> T getNativeRequest() {
181
185
@ Override
182
186
@ Nullable
183
187
protected String initId () {
184
- return this .request instanceof Connection ?
185
- ((Connection ) this .request ).channel ().id ().asShortText () : null ;
188
+ if (this .request instanceof Connection ) {
189
+ return ((Connection ) this .request ).channel ().id ().asShortText () +
190
+ "-" + logPrefixIndex .incrementAndGet ();
191
+ }
192
+ return null ;
186
193
}
187
194
188
195
}
You can’t perform that action at this time.
0 commit comments