Append unique number to log prefix for Undertow
Closes gh-26430
This commit is contained in:
parent
e4566c11b8
commit
bad8954e65
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
import javax.net.ssl.SSLSession;
|
import javax.net.ssl.SSLSession;
|
||||||
|
|
||||||
|
@ -50,6 +51,9 @@ import org.springframework.util.StringUtils;
|
||||||
*/
|
*/
|
||||||
class UndertowServerHttpRequest extends AbstractServerHttpRequest {
|
class UndertowServerHttpRequest extends AbstractServerHttpRequest {
|
||||||
|
|
||||||
|
private static final AtomicLong logPrefixIndex = new AtomicLong();
|
||||||
|
|
||||||
|
|
||||||
private final HttpServerExchange exchange;
|
private final HttpServerExchange exchange;
|
||||||
|
|
||||||
private final RequestBodyPublisher body;
|
private final RequestBodyPublisher body;
|
||||||
|
@ -125,7 +129,8 @@ class UndertowServerHttpRequest extends AbstractServerHttpRequest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String initId() {
|
protected String initId() {
|
||||||
return ObjectUtils.getIdentityHexString(this.exchange.getConnection());
|
return ObjectUtils.getIdentityHexString(this.exchange.getConnection()) +
|
||||||
|
"-" + logPrefixIndex.incrementAndGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue