Skip to main content



      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 16:04 Go to next message
Eclipse UserFriend
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 03:58 Go to previous messageGo to next message
Eclipse UserFriend
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 07:09 Go to previous messageGo to next message
Eclipse UserFriend
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 04:14 Go to previous messageGo to next message
Eclipse UserFriend
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 08:23 Go to previous message
Eclipse UserFriend
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: Fri May 16 08:12:14 EDT 2025

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

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

Back to the top