Question

I am writing an Eclipse 3.7 Plugin. I am new to Eclipse PDE but not to JAVA. I am trying to understand the logging strategy that should be used. My questions is -

  1. How should I go about logging from my plugin? I found a couple of resources ( Eclipse PDE Logging) but I am still not very clear as to how I should go about it. A code snippet will be helpful.

  2. Where will these files be placed?

Update : I did some more research and found Status Manager. But still not clear how it should be used.

Was it helpful?

Solution

Every plugin has its own logger already available. Its usage is described in a short FAQ page on the Eclipse website. The main benefit of using that logger is that your plugin shows its logging entries in the error log view of Eclipse like every other plugin. If you want to deploy your plugins as Eclipse application, you can then have the error log view bundled in a separate optional feature, so that your users can choose to have this log view in the application available or not.

There is also another FAQ about all the available log files. But if you use the error log view, you will normally not need to search or manipulate the log file directly. And also for end users, it is probably more convinient to look at the errors directly in the application, with the possibility to export the log directly from the UI.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top