Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » logging in eclipse
logging in eclipse [message #77652] Mon, 20 November 2006 13:29 Go to next message
Eclipse UserFriend
Originally posted by: ridcully560.yahoo.com

Hello,

when I start the OSGi-framework with my bundles and jetty under eclipse,
I always get the error message that the logger isn't configured right. I
think that message comes from some eclipse-bundle, as I'm not using any
logging in my bundles so far.

> osgi> log4j:WARN No appenders could be found for logger (org.mortbay.util.Container).
> log4j:WARN Please initialize the log4j system properly.

I searched but haven't found out how I could configure it (as there's no
source in the org.mortbay.jetty bundle).

These are the running bundles (next to my own):

> 0 ACTIVE system.bundle_3.2.0.v20060601
> 4 ACTIVE javax.servlet_2.4.0.qualifier
> 5 ACTIVE javax.servlet.jsp_2.0.0.qualifier
> 6 ACTIVE org.apache.ant_1.6.5
> 7 ACTIVE org.apache.commons.el_1.0.0
> 8 ACTIVE org.apache.commons_logging_1.0.4.v200608011657
> 9 ACTIVE org.apache.jakarta_log4j_1.2.8.v200607172048
> 10 ACTIVE org.apache.jasper_5.5.17.qualifier
> 11 ACTIVE org.apache.xerces_2.8.0.v200606131651
> 12 ACTIVE org.eclipse.core.jobs_3.2.0.v20060603
> 13 RESOLVED org.eclipse.core.runtime.compatibility.registry_3.2.0.v20060 603
> Master=20
> 14 ACTIVE org.eclipse.equinox.common_3.2.0.v20060603
> 15 ACTIVE org.eclipse.equinox.http.jetty_1.0.0.qualifier
> 16 ACTIVE org.eclipse.equinox.http.registry_1.0.0.qualifier
> 17 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.qualifier
> 18 ACTIVE org.eclipse.equinox.jsp.jasper_1.0.0.qualifier
> 19 ACTIVE org.eclipse.equinox.jsp.jstl_1.0.0
> 20 ACTIVE org.eclipse.equinox.registry_3.2.0.v20060601
> Fragments=13
> 21 ACTIVE org.eclipse.equinox.servlet.api_1.0.0.v20060601
> 22 ACTIVE org.eclipse.osgi.services_3.1.100.v20060601
> 23 ACTIVE org.mortbay.jetty_5.1.11.qualifier

Johannes
Re: logging in eclipse [message #77670 is a reply to message #77652] Mon, 20 November 2006 13:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tonimenzel.gmx.de

You need to have a log4j.properties file in your resources of the
jetty-bundle to configure a library called log4j (by apache) properly.
The jetty-lib requires that in your current configuration.
Chances are that you can switch that off (logging in general), but for
now, a file mentioned above should help.

Try this content for log4j.properties:

log4j.rootCategory=INFO,A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} %20.30c %-5p %m%n

What version of jetty does your bundle use?
(they refactored pretty much in version 6 since the 5.x stack)

regards,
Toni

Johannes schrieb:
> Hello,
>
> when I start the OSGi-framework with my bundles and jetty under eclipse,
> I always get the error message that the logger isn't configured right. I
> think that message comes from some eclipse-bundle, as I'm not using any
> logging in my bundles so far.
>
>> osgi> log4j:WARN No appenders could be found for logger
>> (org.mortbay.util.Container).
>> log4j:WARN Please initialize the log4j system properly.
>
> I searched but haven't found out how I could configure it (as there's no
> source in the org.mortbay.jetty bundle).
>
> These are the running bundles (next to my own):
>
>> 0 ACTIVE system.bundle_3.2.0.v20060601
>> 4 ACTIVE javax.servlet_2.4.0.qualifier
>> 5 ACTIVE javax.servlet.jsp_2.0.0.qualifier
>> 6 ACTIVE org.apache.ant_1.6.5
>> 7 ACTIVE org.apache.commons.el_1.0.0
>> 8 ACTIVE org.apache.commons_logging_1.0.4.v200608011657
>> 9 ACTIVE org.apache.jakarta_log4j_1.2.8.v200607172048
>> 10 ACTIVE org.apache.jasper_5.5.17.qualifier
>> 11 ACTIVE org.apache.xerces_2.8.0.v200606131651
>> 12 ACTIVE org.eclipse.core.jobs_3.2.0.v20060603
>> 13 RESOLVED
>> org.eclipse.core.runtime.compatibility.registry_3.2.0.v20060 603
>> Master=20
>> 14 ACTIVE org.eclipse.equinox.common_3.2.0.v20060603
>> 15 ACTIVE org.eclipse.equinox.http.jetty_1.0.0.qualifier
>> 16 ACTIVE org.eclipse.equinox.http.registry_1.0.0.qualifier
>> 17 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.qualifier
>> 18 ACTIVE org.eclipse.equinox.jsp.jasper_1.0.0.qualifier
>> 19 ACTIVE org.eclipse.equinox.jsp.jstl_1.0.0
>> 20 ACTIVE org.eclipse.equinox.registry_3.2.0.v20060601
>> Fragments=13
>> 21 ACTIVE org.eclipse.equinox.servlet.api_1.0.0.v20060601
>> 22 ACTIVE org.eclipse.osgi.services_3.1.100.v20060601
>> 23 ACTIVE org.mortbay.jetty_5.1.11.qualifier
>
> Johannes
Re: logging in eclipse [message #77685 is a reply to message #77670] Mon, 20 November 2006 15:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ridcully560.yahoo.com

Thanks so far, I tried, but I didn't get far. The jetty-bundle is the
one from eclipse, where more or less just the Activator class is
present. I think it is working with jetty 5.1.11 (?). Do I just have to
copy the properties-file somewhere, or do I have to register it as a
recource in the Activator?

Toni Menzel schrieb:
> You need to have a log4j.properties file in your resources of the
> jetty-bundle to configure a library called log4j (by apache) properly.
> The jetty-lib requires that in your current configuration.
> Chances are that you can switch that off (logging in general), but for
> now, a file mentioned above should help.
>
> Try this content for log4j.properties:
>
> log4j.rootCategory=INFO,A1
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} %20.30c %-5p %m%n
>
> What version of jetty does your bundle use?
> (they refactored pretty much in version 6 since the 5.x stack)
>
> regards,
> Toni
>
> Johannes schrieb:
>> Hello,
>>
>> when I start the OSGi-framework with my bundles and jetty under
>> eclipse, I always get the error message that the logger isn't
>> configured right. I think that message comes from some eclipse-bundle,
>> as I'm not using any logging in my bundles so far.
>>
>>> osgi> log4j:WARN No appenders could be found for logger
>>> (org.mortbay.util.Container).
>>> log4j:WARN Please initialize the log4j system properly.
>>
>> I searched but haven't found out how I could configure it (as there's
>> no source in the org.mortbay.jetty bundle).
>>
>> These are the running bundles (next to my own):
>>
>>> 0 ACTIVE system.bundle_3.2.0.v20060601
>>> 4 ACTIVE javax.servlet_2.4.0.qualifier
>>> 5 ACTIVE javax.servlet.jsp_2.0.0.qualifier
>>> 6 ACTIVE org.apache.ant_1.6.5
>>> 7 ACTIVE org.apache.commons.el_1.0.0
>>> 8 ACTIVE org.apache.commons_logging_1.0.4.v200608011657
>>> 9 ACTIVE org.apache.jakarta_log4j_1.2.8.v200607172048
>>> 10 ACTIVE org.apache.jasper_5.5.17.qualifier
>>> 11 ACTIVE org.apache.xerces_2.8.0.v200606131651
>>> 12 ACTIVE org.eclipse.core.jobs_3.2.0.v20060603
>>> 13 RESOLVED
>>> org.eclipse.core.runtime.compatibility.registry_3.2.0.v20060 603
>>> Master=20
>>> 14 ACTIVE org.eclipse.equinox.common_3.2.0.v20060603
>>> 15 ACTIVE org.eclipse.equinox.http.jetty_1.0.0.qualifier
>>> 16 ACTIVE org.eclipse.equinox.http.registry_1.0.0.qualifier
>>> 17 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.qualifier
>>> 18 ACTIVE org.eclipse.equinox.jsp.jasper_1.0.0.qualifier
>>> 19 ACTIVE org.eclipse.equinox.jsp.jstl_1.0.0
>>> 20 ACTIVE org.eclipse.equinox.registry_3.2.0.v20060601
>>> Fragments=13
>>> 21 ACTIVE org.eclipse.equinox.servlet.api_1.0.0.v20060601
>>> 22 ACTIVE org.eclipse.osgi.services_3.1.100.v20060601
>>> 23 ACTIVE org.mortbay.jetty_5.1.11.qualifier
>>
>> Johannes
Re: logging in eclipse [message #77717 is a reply to message #77685] Mon, 20 November 2006 18:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tonimenzel.gmx.de

I think this is just a wrapper bundle for jetty.

There must be a configuration-based solution, but I don't know the
bundle so, this is the handmade solution:

If you want, you can put the log4.properties inside the root of your
plugin/bundle jarfile.
Any resource in an osgi bundle must be declared in the MANIFEST.MF with
(for example)
Bundle-Classpath: log4j.properties
(the same way you can add any resource to the bundle).
If you use the PDE, you can do this in an interactive way.

If you want, you can point me to the bundle location and I will try it
myself (I am a pretty much a osgi-trainee, too;-)
Toni




Johannes schrieb:
> Thanks so far, I tried, but I didn't get far. The jetty-bundle is the
> one from eclipse, where more or less just the Activator class is
> present. I think it is working with jetty 5.1.11 (?). Do I just have to
> copy the properties-file somewhere, or do I have to register it as a
> recource in the Activator?
>
> Toni Menzel schrieb:
>> You need to have a log4j.properties file in your resources of the
>> jetty-bundle to configure a library called log4j (by apache) properly.
>> The jetty-lib requires that in your current configuration.
>> Chances are that you can switch that off (logging in general), but for
>> now, a file mentioned above should help.
>>
>> Try this content for log4j.properties:
>>
>> log4j.rootCategory=INFO,A1
>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>> log4j.appender.A1.layout.ConversionPattern=%d{ISO8601} %20.30c %-5p %m%n
>>
>> What version of jetty does your bundle use?
>> (they refactored pretty much in version 6 since the 5.x stack)
>>
>> regards,
>> Toni
>>
>> Johannes schrieb:
>>> Hello,
>>>
>>> when I start the OSGi-framework with my bundles and jetty under
>>> eclipse, I always get the error message that the logger isn't
>>> configured right. I think that message comes from some
>>> eclipse-bundle, as I'm not using any logging in my bundles so far.
>>>
>>>> osgi> log4j:WARN No appenders could be found for logger
>>>> (org.mortbay.util.Container).
>>>> log4j:WARN Please initialize the log4j system properly.
>>>
>>> I searched but haven't found out how I could configure it (as there's
>>> no source in the org.mortbay.jetty bundle).
>>>
>>> These are the running bundles (next to my own):
>>>
>>>> 0 ACTIVE system.bundle_3.2.0.v20060601
>>>> 4 ACTIVE javax.servlet_2.4.0.qualifier
>>>> 5 ACTIVE javax.servlet.jsp_2.0.0.qualifier
>>>> 6 ACTIVE org.apache.ant_1.6.5
>>>> 7 ACTIVE org.apache.commons.el_1.0.0
>>>> 8 ACTIVE org.apache.commons_logging_1.0.4.v200608011657
>>>> 9 ACTIVE org.apache.jakarta_log4j_1.2.8.v200607172048
>>>> 10 ACTIVE org.apache.jasper_5.5.17.qualifier
>>>> 11 ACTIVE org.apache.xerces_2.8.0.v200606131651
>>>> 12 ACTIVE org.eclipse.core.jobs_3.2.0.v20060603
>>>> 13 RESOLVED
>>>> org.eclipse.core.runtime.compatibility.registry_3.2.0.v20060 603
>>>> Master=20
>>>> 14 ACTIVE org.eclipse.equinox.common_3.2.0.v20060603
>>>> 15 ACTIVE org.eclipse.equinox.http.jetty_1.0.0.qualifier
>>>> 16 ACTIVE org.eclipse.equinox.http.registry_1.0.0.qualifier
>>>> 17 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.qualifier
>>>> 18 ACTIVE org.eclipse.equinox.jsp.jasper_1.0.0.qualifier
>>>> 19 ACTIVE org.eclipse.equinox.jsp.jstl_1.0.0
>>>> 20 ACTIVE org.eclipse.equinox.registry_3.2.0.v20060601
>>>> Fragments=13
>>>> 21 ACTIVE org.eclipse.equinox.servlet.api_1.0.0.v20060601
>>>> 22 ACTIVE org.eclipse.osgi.services_3.1.100.v20060601
>>>> 23 ACTIVE org.mortbay.jetty_5.1.11.qualifier
>>>
>>> Johannes
Re: logging in eclipse [message #77780 is a reply to message #77652] Tue, 21 November 2006 04:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: skaegi.sympatico.ca

Hi Johannes,

This is a bit of a chain.
Jetty (5.1.11) use jakarta commons logging to handle its logging and the way
the JCL bundle is setup and in particular what packages imported has a
strong influence on how logging behaviour in your system. In your case it
looks like your JCL bundle is setup in such a way that it is finding log4j.
log4j in turn is looking for config information for the logger
"org.mortbay.util.Container" and finding nothing.

So, the short answer for your set of bundles, is to put a log4j.properties
file similar to what Toni suggested at the root of your log4j bundle and
make sure that "." is on your bundle classpath.
--
The longer answer is that although this approach is adequate for a static
application, it's not really a very good solution for a more dynamic
environment where componentst (and loggers) come and go. This is a bit of an
open problem and hopefully something we can improve. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=147824 for one possible first
step.

-Simon

"Johannes" <ridcully560@yahoo.com> wrote in message
news:ejsaio$jj$1@utils.eclipse.org...
> Hello,
>
> when I start the OSGi-framework with my bundles and jetty under eclipse,
> I always get the error message that the logger isn't configured right. I
> think that message comes from some eclipse-bundle, as I'm not using any
> logging in my bundles so far.
>
> > osgi> log4j:WARN No appenders could be found for logger
(org.mortbay.util.Container).
> > log4j:WARN Please initialize the log4j system properly.
>
> I searched but haven't found out how I could configure it (as there's no
> source in the org.mortbay.jetty bundle).
>
> These are the running bundles (next to my own):
>
> > 0 ACTIVE system.bundle_3.2.0.v20060601
> > 4 ACTIVE javax.servlet_2.4.0.qualifier
> > 5 ACTIVE javax.servlet.jsp_2.0.0.qualifier
> > 6 ACTIVE org.apache.ant_1.6.5
> > 7 ACTIVE org.apache.commons.el_1.0.0
> > 8 ACTIVE org.apache.commons_logging_1.0.4.v200608011657
> > 9 ACTIVE org.apache.jakarta_log4j_1.2.8.v200607172048
> > 10 ACTIVE org.apache.jasper_5.5.17.qualifier
> > 11 ACTIVE org.apache.xerces_2.8.0.v200606131651
> > 12 ACTIVE org.eclipse.core.jobs_3.2.0.v20060603
> > 13 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.2.0.v20060 603
> > Master=20
> > 14 ACTIVE org.eclipse.equinox.common_3.2.0.v20060603
> > 15 ACTIVE org.eclipse.equinox.http.jetty_1.0.0.qualifier
> > 16 ACTIVE org.eclipse.equinox.http.registry_1.0.0.qualifier
> > 17 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.qualifier
> > 18 ACTIVE org.eclipse.equinox.jsp.jasper_1.0.0.qualifier
> > 19 ACTIVE org.eclipse.equinox.jsp.jstl_1.0.0
> > 20 ACTIVE org.eclipse.equinox.registry_3.2.0.v20060601
> > Fragments=13
> > 21 ACTIVE org.eclipse.equinox.servlet.api_1.0.0.v20060601
> > 22 ACTIVE org.eclipse.osgi.services_3.1.100.v20060601
> > 23 ACTIVE org.mortbay.jetty_5.1.11.qualifier
>
> Johannes
Re: logging in eclipse [message #77828 is a reply to message #77780] Tue, 21 November 2006 18:44 Go to previous message
Eclipse UserFriend
Originally posted by: ridcully560.yahoo.com

Thanks, the posts of you two helped!

At least jetty is logging by now. Reading the bug Simon mentioned, there
seems to be some kind of OSGi-logger. If one could give me a short howto
or a link to some howto that would be great. As I need some logging in
my own bundles, and I think the bundles in my application who do log are
all without source, so I can't have a look there.

Johannes
Previous Topic:Struggling with converting lib jar to bundle
Next Topic:In an RCP application what causes an home/.eclipse dir to be created on unix for some users but not
Goto Forum:
  


Current Time: Fri Apr 26 13:47:48 GMT 2024

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

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

Back to the top