[logback-user] RCP

Tony Trinh tony19 at gmail.com
Thu May 24 18:27:38 CEST 2012


On Thu, May 24, 2012 at 11:25 AM, Tony Trinh <tony19 at gmail.com> wrote:

>
> 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:
>
> 1. From Eclipse, import the attached sample project (choose menu "File >
> Import... > Existing Projects into Workspace").
> 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.
> 3. Rebuild and run the project (which opens a new instance of Eclipse).
> 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.
>
> I updated EclipseLogAppender 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:

<configuration>
<appender name="eclipse" class="ch.qos.logback.classic.EclipseLogAppender">
 <encoder>
<pattern>[%method] > %msg%n</pattern>
 </encoder>
 <bundleName>com.example.e4.helloworld</bundleName>
</appender>

<root level="TRACE">
<appender-ref ref="eclipse" />
 </root>
</configuration>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120524/a422f976/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EclipseLogAppender-example-v2.tgz
Type: application/x-gzip
Size: 7436 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120524/a422f976/attachment-0001.bin>


More information about the Logback-user mailing list