Skip to content

Instantly share code, notes, and snippets.

@maxandersen
Created September 28, 2020 07:57
Show Gist options
  • Save maxandersen/283d93bf8b77e351eb56abc1f9915ab7 to your computer and use it in GitHub Desktop.
Save maxandersen/283d93bf8b77e351eb56abc1f9915ab7 to your computer and use it in GitHub Desktop.
How to log http url network in java

How to log http traffic with Java JDK

Here is how to debug http network traffic in java app:

Save log.properties in a directory and pass it to your java app:

if using java: java -Djava.util.logging.config.file=log.properties …​

using jbang: jbang -Djava.util.logging.config.file=log.properties yourapp.java

handlers= java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level = FINEST
sun.net.www.protocol.http.HttpURLConnection.level=ALL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment