Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Activate simple logging for a bundle(Logging for a bundle)
Activate simple logging for a bundle [message #846132] Sun, 15 April 2012 20:04 Go to next message
Stefan Huber is currently offline Stefan HuberFriend
Messages: 3
Registered: April 2012
Junior Member
Dear all,

I am quite stuck Sad ...

I have created a bundle, but logging doesn't work and I don't know how I can activate it...

I have tried to use sl4j-api or just System.out.println, I searched through all log.log files, but my logging is nowhere. I have also tried to add a logback.xml file with logback configuration to the root of the jar, which however also didn't work...

Please, could anybody help me how to activate logging for a simple bundle (no par or plans)!
Re: Activate simple logging for a bundle [message #846603 is a reply to message #846132] Mon, 16 April 2012 07:58 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Did you edit config[uration]/serviceability.xml to enable an appropriate level of trace?
Re: Activate simple logging for a bundle [message #846628 is a reply to message #846603] Mon, 16 April 2012 11:09 Go to previous messageGo to next message
Stefan Huber is currently offline Stefan HuberFriend
Messages: 3
Registered: April 2012
Junior Member
I didn't change anything from the default config. I added the following logback.xml to the root of the bundle (jar)...

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

  <appender name="STOUT" class="ch.qos.logback.core.ConsoleAppender">
    <!-- encoders are assigned the type
         ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>

  <root level="info">
    <appender-ref ref="STOUT" />
  </root>
</configuration>


I must admit, that I am no expert in the logback configuration, if you could tell me what to add to the defaul config would be great!
Re: Activate simple logging for a bundle [message #847353 is a reply to message #846628] Tue, 17 April 2012 08:14 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Please see the excellent logback manual, specifically this section.
Re: Activate simple logging for a bundle [message #856157 is a reply to message #847353] Wed, 25 April 2012 12:23 Go to previous message
Stefan Huber is currently offline Stefan HuberFriend
Messages: 3
Registered: April 2012
Junior Member
My solution how I activited logging for a bundle is as follows:

  1. Adding a logback.xml to the root of the bundle
  2. Referencing the org.eclipse.virgo.medic.eventlog.EventLogger service within the spring container definition
  3. Adding the Import Statement for the org.eclipse.virgo.medic.eventlog Package in the Manifest

if there is a better approach, please inform me...
Previous Topic:Virgo 3.5.0.M03 released
Next Topic:unable to deploy roo 1.1.0 war on virgo web server 2.1.0
Goto Forum:
  


Current Time: Sat Nov 29 09:11:14 GMT 2014

Powered by FUDForum. Page generated in 0.01788 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software