I have written an RCP application. For that I want to add logging using log4j.
Can any one suggest any solution for it?
I already tried with this, but I am unable to use it.
Any help is appreciated!
Consider using the Eclipse logging. It is decribed in the Eclipse Wiki: http://wiki.eclipse.org/E4/EAS/Logging_and_Tracing
This way you have the advantage that the logging from the RCP platform and your own logging share the same logfiles. This makes it easier to correlate events in the log file(s).
If you are using E4 already it is easy to inject the log-service (i.e. you won't need an activator class for your plugin). The wiki reference above also describes how to do that.