Skip to content

Instantly share code, notes, and snippets.

@tivrfoa
Forked from maxandersen/log.properties
Created September 28, 2020 09:24
Show Gist options
  • Save tivrfoa/3d26da83402670fd7d3a1a8aafbc5d89 to your computer and use it in GitHub Desktop.
Save tivrfoa/3d26da83402670fd7d3a1a8aafbc5d89 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