From d9feb1d4d7caf85543234059f3f3f90e07425f79 Mon Sep 17 00:00:00 2001 From: WolfgangHG Date: Wed, 27 Sep 2023 19:49:00 +0200 Subject: [PATCH] [issue #153] update commandline samples to use file-leak-detector-jar-with-dependencies.jar, added sample for permanent logging --- README.adoc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.adoc b/README.adoc index 026c582..3cf02bd 100644 --- a/README.adoc +++ b/README.adoc @@ -23,7 +23,7 @@ Without any options, this tool silently records file open/close operations and u [source,sh] ---- -$ java -javaagent:path/to/file-leak-detector.jar ...your usual Java arguments follow... +$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar ...your usual Java arguments follow... ---- There are several options you can pass to the agent. @@ -31,21 +31,28 @@ For example, to dump the open file descriptors when the total number reaches 200 [source,sh] ---- -$ java -javaagent:path/to/file-leak-detector.jar=threshold=200 ...your usual Java arguments follow... +$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar=threshold=200 ...your usual Java arguments follow... +---- + +Continuous logging of every opened/closed file: + +[source,sh] +---- +$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar=trace=/path/to/logfile.txt ...your usual Java arguments follow... ---- Or to have it run a mini HTTP server so that you can access the information from your browser, do the following and open http://localhost:19999/: [source,sh] ---- -$ java -javaagent:path/to/file-leak-detector.jar=http=19999 ...your usual Java arguments follow... +$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar=http=19999 ...your usual Java arguments follow... ---- Use the help option to see the help screen for the complete list of options: [source,sh] ---- -$ java -javaagent:path/to/file-leak-detector.jar=help +$ java -javaagent:path/to/file-leak-detector-jar-with-dependencies.jar=help ---- == Attaching after JVM startup @@ -57,7 +64,7 @@ Options can be specified in the second argument in the same format you do to the [source,sh] ---- -$ java -jar path/to/file-leak-detector.jar 1500 threshold=200,strong +$ java -jar path/to/file-leak-detector-jar-with-dependencies.jar 1500 threshold=200,strong ---- == Supported options