Search code examples
eclipsercptrace

How do I set the 'Enable tracing' preference in an RCP application?


I have an RCP application comprising of an number of plug-ins. Each plug-in contains an .options file containing trace information.

I would like to deploy the application with the Enable tracing preference set. This will enable tracing using the information defined in the option files.

How can I initially set the Enable tracing preference ?

UPDATE

I have tried following up on greg-449's answer but without success.

I created a custom.prefs file which is loaded using an entry in the product.ini file.

-Declipse.pluginCustomization=custom.prefs

custom.prefs:

org.eclipse.ui.editors/spacesForTabs=true
org.eclipse.ui.editors/tabWidth=3

org.eclipse.ui.trace/tracingEnabled=true
org.eclipse.ui.trace/tracingFilePath=atf.log
org.eclipse.ui.trace/tracingMaxFileCount=5
org.eclipse.ui.trace/tracingMaxFileSize=2000
org.eclipse.ui.trace/tracingEntries=tracingEntries=...my entries....

I added the editors prefs just as an indicator that the custom prefs were loading. When I view the editor preference page I see that the tab size is set to 3 and tabs replaced by spaces. However the tracing options remain unchanged - i.e. disabled

(I'm using Kepler and the product is based on plugins only)


Solution

  • The tracing preferences page saves the preference settings in the org.eclipse.ui.trace preferences. So they are stored in the workspace .metadata/.plugins/org.eclipse.core.runtime/.settings directory in the org.eclipse.ui.trace.prefs file.

    You can set initial values for the preferences using a plugin_customization.ini file in your RCP. For example to enable preferences the entry would would be:

    org.eclipse.ui.trace/tracingEnabled=true