Skip to content

Commit bad8954

Browse files
committed
Append unique number to log prefix for Undertow
Closes gh-26430
1 parent e4566c1 commit bad8954

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

spring-web/src/main/java/org/springframework/http/server/reactive/UndertowServerHttpRequest.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
2121
import java.net.URI;
2222
import java.net.URISyntaxException;
2323
import java.nio.ByteBuffer;
24+
import java.util.concurrent.atomic.AtomicLong;
2425

2526
import javax.net.ssl.SSLSession;
2627

@@ -50,6 +51,9 @@
5051
*/
5152
class UndertowServerHttpRequest extends AbstractServerHttpRequest {
5253

54+
private static final AtomicLong logPrefixIndex = new AtomicLong();
55+
56+
5357
private final HttpServerExchange exchange;
5458

5559
private final RequestBodyPublisher body;
@@ -125,7 +129,8 @@ public <T> T getNativeRequest() {
125129

126130
@Override
127131
protected String initId() {
128-
return ObjectUtils.getIdentityHexString(this.exchange.getConnection());
132+
return ObjectUtils.getIdentityHexString(this.exchange.getConnection()) +
133+
"-" + logPrefixIndex.incrementAndGet();
129134
}
130135

131136

0 commit comments

Comments
 (0)