0

I have a RCP application, in which I am using log4j.properties. I have kept this file just under the root file.
Now while using it inside a java file I must use the following lines :

BasicConfigurator.configure();
PropertyConfigurator.configure(log4jConfPath);

But, for that purpose, I need to know the path for the exported log4j.properties. But, as currently no .properties is getting exported with RCP product export, I need to place them manually, use that path as log4jConfPath.

So, how can I export the log4j.properties in the RCP product.

Thanks!

Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
Srijani Ghosh
  • 3,935
  • 7
  • 37
  • 68

1 Answers1

2

If you build your RCP using features you can add extra files to the install root using the 'root' directive in the build.properties file for the feature. Something like:

bin.includes = feature.xml
root=file:log4j.properties

Note: this only works in a feature project, it will not work in a plugin. There is more information in the Eclipse help

When you run the RCP you can find the install directory using:

Location loc = Platform.getInstallLocation();
greg-449
  • 109,219
  • 232
  • 102
  • 145