views:

19

answers:

1

I am new to creating plug-ins, and there's much that I don't understand. One of these mysteries is logging.

I have legacy code that I want to be able to use both within the plug-in and in the old standalone code. This code uses java.util.logging.

I debug my plug-in by starting up a new workbench using a JVM option -Djava.util.logging.config.file=/completelySpecifiedPath/logging.properties. The logging.properties file appears to be read, because the file specified by java.util.logging.FileHandler.pattern is being written. Unfortunately, the custom formatter that I specified via java.util.logging.FileHandler.formatter does not seem to get called; the output in the file is in what looks to be a default XML format. The logging works okay in the legacy code, i.e., my custom formatter gets used.

One thing I am wondering about is how the plug-in handles the logging dependencies. Is it possible that I need to explicitly enter some logging dependencies in MANIFEST.MF? I don't see how Eclipse could calculate the dependency for me, because the dependency isn't in code, rather it's in the logging.properties file. Furthermore, is it possible or desirable to say that java.util.logging depends on my class?

Any help and/or ideas would be much appreciated.

Cheers, Keith

A: 

This appears to be an Eclipse bug that won't be fixed any time soon. If you want to use a custom formatter, you'll need to specify it in code, rather than by using logging.properties.

kc2001