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 12:11 Go to next message
Tobias Lelle is currently offline Tobias Lelle
Messages: 38
Registered: February 2013
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 12:28 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 271
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 12:32 Go to previous messageGo to next message
Tobias Lelle is currently offline Tobias Lelle
Messages: 38
Registered: February 2013
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 12:46 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 271
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 00:57 Go to previous message
saurabh chhajed is currently offline saurabh chhajed
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: Wed Jul 30 23:34:44 EDT 2014

Powered by FUDForum. Page generated in 0.01869 seconds