Can't get java.util.logging to work with application launched via JNLP

For debugging purposes, I would like my application to register with java.util.logging.SocketHandler. Here is my config file:

handlers = java.util.logging.SocketHandler
.level = WARNING
java.util.logging.SocketHandler.level = ALL
java.util.logging.SocketHandler.formatter = java.util.logging.SimpleFormatter = localhost
java.util.logging.SocketHandler.port = 10101
com.mycompany.level = ALL


This logging configuration file is associated with the application bank and read from the main one. When I run the app offline, the logging works as expected. I see that the log entries are being pushed to localhost: 10101. However, when I run the application via JNLP, you don't see any logs. Here is my JNLP config file:

<jnlp spec="1.0+" codebase="" href="myapp.jnlp">
    <title>My App</title>
    <vendor>My Company</vendor>
    <j2se version="1.6+"/>
    <jar href="myapp.jar"/>
  <application-desc main-class="com.mycompany.Main"/>


I haven't found any information and see no reason why this shouldn't work. Could anyone help make this work? Or suggest another (maybe better?) Way to capture registration from an application launched via JNLP.


source to share

1 answer

Well, I figured it out. It turns out my problem was how I was loading the logging properties file as a resource. I used:



But I had to use:





All Articles