Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Using logback in OSGI Bundle
Using logback in OSGI Bundle [message #772817] Fri, 30 December 2011 17:11 Go to next message
Eclipse GuestFriend
Messages: 93
Registered: February 2013
Location: Vienna
Member
Hello,
I am trying to use logback in my OSGI bundle. I see that the bundle starts up successfully and appears as "ACTIVE" in the Virgo Admin Console. However I do not find the log statements in any log files.

Please let me know if I need to configure any additional steps.

I am dropping the hellobundle-1.0.0.jar into the pickup folder to start the bundle.

I have attached the source code and the jar file for my OSGI bundle.


Thanks,
Arun
Re: Using logback in OSGI Bundle [message #772823 is a reply to message #772817] Fri, 30 December 2011 17:28 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 278
Registered: January 2010
Senior Member
How do you set-up configuration for logback in $VIRGO_HOME/config/serviceability.xml or trying to provide your own logback.xml in bundle (sorry did not look at the code)

Dmitry
Re: Using logback in OSGI Bundle [message #772825 is a reply to message #772823] Fri, 30 December 2011 17:32 Go to previous messageGo to next message
Eclipse GuestFriend
Messages: 93
Registered: February 2013
Location: Vienna
Member
I am providing my own logback.xml file in the bundle.

The file contents are as below.

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

<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p | %t | %-55logger{55} | %m %n</pattern>
</encoder>
</appender>
<logger name="com.hello">
<level value="INFO" />
</logger>
<root>
<level value="INFO" />
<appender-ref ref="CONSOLE" />
</root>
</configuration>


File is located in package com.hello.resources

Thanks,
Arun

Re: Using logback in OSGI Bundle [message #772830 is a reply to message #772825] Fri, 30 December 2011 17:46 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 278
Registered: January 2010
Senior Member
Arun, move that logback.xml to the root of the bundle. Even without osgi - logback looks in the root of the application classpath for the config file. In virgo - there a component called medic that should examine bundles on start up and pickup that logback.xml config file for this bundle only. i.e. do not expect this configuration to be global across bundles in the container.

Dmitry
Re: Using logback in OSGI Bundle [message #830820 is a reply to message #772817] Wed, 28 March 2012 04:57 Go to previous message
saurabh chhajed is currently offline saurabh chhajedFriend
Messages: 1
Registered: March 2012
Junior Member
Hi Arun,

I am trying to implement something similar to this.Were you able to successfully implement this after the suggested solution.

Previous Topic:ImportMergeException for aspectj
Next Topic:Virgo server memory problem
Goto Forum:
  


Current Time: Mon Dec 22 12:53:53 GMT 2014

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

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