title: How to use log4j in an Eclipse RCP?
body: <p>How to use log4j logging API in an Eclipse RCP project?</p>
  
  <p>As a workaround U tried to create a new OSGI Bundle which has a log4j jars, below is the bundle structure:</p>
  
  <p><img src="https://i.stack.imgur.com/Xidwt.gif" alt="log4j an external plugin"></p>
  
  <p>I've crated a basic <strong>RCP application with a view</strong>(template)  named <strong><em>loggingtest</em></strong>.I've included the bundle log4j in the dependencies tab of loggingtest project.In the Activator start method i placed the following code </p>
  
  <pre><code>Logger logger = Logger.getLogger(Activator.class);
  logger.info("Info starting");
  logger.warn("Warning starting");
  logger.error("Error starting");
  </code></pre>
  
  <p>so everything is fine so far I'm able to use log4j API and half way through,i was puzzled as where to place the log4j.properties file,how can i proceed further to get a log file with all log statements.</p>
  
  <p>to be more precise below is the content of my manifest file of loggingtest project</p>
  
  <pre><code>Manifest-Version: 1.0
  Bundle-ManifestVersion: 2
  Bundle-Name: LoggingTest
  Bundle-SymbolicName: LoggingTest; singleton:=true
  Bundle-Version: 1.0.0.qualifier
  Bundle-Activator: loggingtest.Activator
  Require-Bundle: org.eclipse.ui,
   org.eclipse.core.runtime,
   log4j;bundle-version="1.0.0"
  Bundle-ActivationPolicy: lazy
  Bundle-RequiredExecutionEnvironment: JavaSE-1.6
  </code></pre>