mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-26 00:39:01 +00:00
Append unique number to log prefix for Undertow
Closes gh-26430
This commit is contained in:
+7
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,6 +21,7 @@ import java.net.InetSocketAddress;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import javax.net.ssl.SSLSession;
|
||||
|
||||
@@ -50,6 +51,9 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
class UndertowServerHttpRequest extends AbstractServerHttpRequest {
|
||||
|
||||
private static final AtomicLong logPrefixIndex = new AtomicLong();
|
||||
|
||||
|
||||
private final HttpServerExchange exchange;
|
||||
|
||||
private final RequestBodyPublisher body;
|
||||
@@ -125,7 +129,8 @@ class UndertowServerHttpRequest extends AbstractServerHttpRequest {
|
||||
|
||||
@Override
|
||||
protected String initId() {
|
||||
return ObjectUtils.getIdentityHexString(this.exchange.getConnection());
|
||||
return ObjectUtils.getIdentityHexString(this.exchange.getConnection()) +
|
||||
"-" + logPrefixIndex.incrementAndGet();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user