<div class="gmail_quote">On Thu, May 24, 2012 at 11:25 AM, Tony Trinh <span dir="ltr"><<a href="mailto:tony19@gmail.com" target="_blank">tony19@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im"><br></div><div><div class="im"><div><div>See the attached sample project with this all working. I created the EclipseLogAppender class, which writes to Eclipse's Error Log. (It would be nice to add this class to logback's source, but it's dependent on Eclipse packages...not sure how to handle that.) To run the example:</div>
<div><br></div></div></div><blockquote><div class="im"><div>1. From Eclipse, import the attached sample project (choose menu "File > Import... > Existing Projects into Workspace").</div></div><div>2. Download logback-core-1.0.3.jar, logback-classic-1.0.3.jar, and slf4j-api-1.6.4.jar into the project's "libs" directory.</div>
<div>3. Rebuild and run the project (which opens a new instance of Eclipse).</div><div class="im"><div>4. From the new instance of Eclipse, open the Error Log (menu "Window > Show Views > Error Log"), and choose menu "Sample Menu > Sample Command". This causes a "Hello World" message box, followed by a log entry in the Error Log.</div>
<div><br></div></div></blockquote></div></div>
</blockquote></div>I updated <font face="courier new, monospace">EclipseLogAppender</font> to decouple it from the plugin; it now requires the plugin bundle's symbolic name (as specified in the "Bundle-SymbolicName" property in the plugin's manifest), which is set in the logback config as seen below:<div>
<br></div><div><div><font face="courier new, monospace"><configuration></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span><appender name="eclipse" class="ch.qos.logback.classic.EclipseLogAppender"></font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span><encoder></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span><pattern>[%method] > %msg%n</pattern></font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span></encoder></font></div><div><span class="Apple-tab-span" style="white-space:pre"><font face="courier new, monospace"> </font></span></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span><bundleName>com.example.e4.helloworld</bundleName></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span></appender></font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span><root level="TRACE"></font></div><div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span><appender-ref ref="eclipse" /></font></div>
<div><font face="courier new, monospace"><span class="Apple-tab-span" style="white-space:pre"> </span></root></font></div><div><font face="courier new, monospace"></configuration></font></div></div>