On Thu, 25 Jun 2026 07:19:19 GMT, Alan Bateman <[email protected]> wrote:

> Does the logging by code in the httpserver include something to identity the 
> instance?

Nope, it doesn't. For tests, it doesn't matter much — since most HTTP server & 
client tests run sequentially. While skimming through logs, you can reliably 
guess which log belongs to which server. That said, for production applications 
containing multiple HTTP servers, an identifier in the log would be super 
helpful while troubleshooting. It'd even help with the cognitive load in test 
logs. @kieran-farrell, @dfuch, do you agree?

> I'm wondering how the log messages look when there is more than one instance 
> in the VM.

They get interleaved. Consider the following JTreg log snippet from a 
`test/jdk/com/sun/net/httpserver/ClearTextServerSSL` execution:


[18:28:00.715] STARTED    ClearTextServerSSL::test 'test()'
Jun 24, 2026 6:28:00 PM sun.net.httpserver.ServerImpl <init>
FINE: HttpServer created http localhost/127.0.0.1:0
Jun 24, 2026 6:28:00 PM sun.net.httpserver.ServerImpl createContext
FINE: context created: /ClearTextServerSSL/
Jun 24, 2026 6:28:01 PM sun.net.httpserver.ServerImpl$Exchange run
FINER: exchange started
Jun 24, 2026 6:28:01 PM sun.net.httpserver.ServerImpl$Exchange run
FINE: Exchange request line: GET /ClearTextServerSSL/clear HTTP/1.1
Jun 24, 2026 6:28:01 PM sun.net.httpserver.ExchangeImpl sendResponseHeaders
FINER: Sent headers: noContentToSend=true

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31670#discussion_r3472668542

Reply via email to