Hi Niclas,

Thanks for your response - I have looked pretty hard again and can't see any 
other logging libraries, on my rcp app I went to the About dialog and showed 
the configuration tab, at a point where I know the plugins have been loaded 
that have been giving me issues I see:

*** Plug-in Registry:
com.ibm.icu (4.0.1.v20090415) "International Components for Unicode for Java 
(ICU4J)" [Active]
...
<my application plugins here/>
...
net.sourceforge.nattable.core (2.0.0) "NatTable Core" [Resolved]
net.sourceforge.nattable.extension.glazedlists (2.0.0) "NatTable GlazedLists 
Extensions" [Resolved]
org.apache.commons.lang (2.3.0.v200803061910) "Apache Jakarta Commons Lang" 
[Resolved]
org.eclipse.core.commands (3.5.0.I20090525-2000) "Commands" [Resolved]
org.eclipse.core.contenttype (3.4.0.v20090429-1800) "Eclipse Content Mechanism" 
[Starting]
org.eclipse.core.databinding (1.2.0.I20090604-2000) "JFace Data Binding" 
[Active]
org.eclipse.core.databinding.beans (1.2.0.I20090525-2000) "JFace Data Binding 
for JavaBeans" [Resolved]
org.eclipse.core.databinding.observable (1.2.0.I20090604-2000) "JFace Data 
Binding Observables" [Active]
org.eclipse.core.databinding.property (1.2.0.I20090526-2000) "JFace Data 
Binding" [Active]
org.eclipse.core.expressions (3.4.100.v20090429-1800) "Expression Language" 
[Active]
org.eclipse.core.jobs (3.4.100.v20090429-1800) "Eclipse Jobs Mechanism" [Active]
org.eclipse.core.runtime (3.5.0.v20090525) "Core Runtime" [Active]
org.eclipse.core.runtime.compatibility.registry (3.2.200.v20090429-1800) 
"Eclipse Registry Compatibility Fragment" [Resolved]
org.eclipse.equinox.app (1.2.0.v20090520-1800) "Equinox Application Container" 
[Active]
org.eclipse.equinox.cm (1.0.100.v20090520-1800) "Configuration Admin" [Active]
org.eclipse.equinox.common (3.5.0.v20090520-1800) "Common Eclipse Runtime" 
[Active]
org.eclipse.equinox.preferences (3.2.300.v20090520-1800) "Eclipse Preferences 
Mechanism" [Active]
org.eclipse.equinox.registry (3.4.100.v20090520-1800) "Extension Registry 
Support" [Active]
org.eclipse.help (3.4.0.v20090526) "Help System Core" [Active]
org.eclipse.jface (3.5.0.I20090525-2000) "JFace" [Active]
org.eclipse.jface.databinding (1.3.0.I20090525-2000) "JFace Data Binding for 
SWT and JFace" [Resolved]
org.eclipse.osgi (3.5.0.v20090520) "OSGi System Bundle" [Active]
org.eclipse.osgi.services (3.2.0.v20090520-1800) "OSGi Release 4.2.0 Services" 
[Active]
org.eclipse.swt (3.5.0.v3550b) "Standard Widget Toolkit" [Resolved]
org.eclipse.swt.win32.win32.x86 (3.5.0.v3550b) "Standard Widget Toolkit for 
Windows" [Resolved]
org.eclipse.ui (3.5.0.I20090604-2000) "Eclipse UI" [Active]
org.eclipse.ui.forms (3.4.0.v20090526) "Eclipse Forms" [Starting]
org.eclipse.ui.workbench (3.5.0.I20090603-2000) "Workbench" [Active]
org.hamcrest.core (1.1.0.v20090501071000) "Hamcrest Core Library of Matchers" 
[Starting]
org.junit4 (4.5.0.v20090423) "JUnit Testing Framework Version 4" [Resolved]
org.ops4j.pax.configmanager (0.2.2) "OPS4J Pax ConfMan - Properties Loader" 
[Active]
org.ops4j.pax.logging.pax-logging-api (1.4) "OPS4J Pax Logging - API" [Resolved]
org.ops4j.pax.logging.pax-logging-service (1.4) "OPS4J Pax Logging - Service" 
[Active]

Not sure if that gives any clues - I'll look tomorrow to see if I can open an 
equinox console on my app.

I ran my app from eclipse in debug and followed the logging call from one of 
the plugins that's not working with my config as desired  - the call went 
straight into the pax-logging implementation of Log4J's Logger.

Does anything above look suspicious? if not perhaps there are some other 
reasons...

Thanks,
Dan

From: [email protected] [mailto:[email protected]] 
On Behalf Of Niclas Hedhman
Sent: 29 October 2009 16:52
To: General OPS4J
Subject: Re: Problem with pax logging getting config


Dan,
I feel for you, and if I had access to the code I could probably trace this 
down within an hour.

First of all, it is VERY likely that you have additional logging system present.

So, if you know which bundle is outputting incorrectly, ask the framework to 
show you wiring of packages for that bundle. Can't recall how to that from the 
Equinox console (in a club now). That is your best bet how to trace this.

A good guess is that one or more bundles include the commons logging original 
classes, which will try to dynamically determine the backend logging system, 
fail and possibly use the internal System out, or JDK logging.

-- Niclas
On 29 Oct 2009 23:02, "Dan S Pollitt" 
<[email protected]<mailto:[email protected]>> wrote:
Hi all,

I am attempting to use pax-logging and pax-confman within an Eclipse RCP 
application to direct all the logging by component plugins etc to a single log 
file for the application, with the configuration for that logging being 
specified within a single properties file. Whilst attempting to get this 
working the (very simple) contents of my config file are:

org.ops4j.pax.logging.properties
================================

# Set Loggers
log4j.rootLogger=ALL, console, file

# Set console appenders
log4j.appender.console=org.apache.log4j.ConsoleAppender

# Set layout
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{ABSOLUTE} '-DAN-' %-10t 
[%-6p] %c: %m%n

log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %-10t [%-6p] %c: %m%n
log4j.appender.file.File=${log.dir}/app.log

================================

I added the '-DAN-' so I could be sure it was tis config that was being picked 
up (or not)

I have followed the steps indicated by the tutorial postings: 
http://www.rcpquickstart.com/2009/07/14/logging-rcp-applications-with-pax-logging/
 and 
http://www.rcpquickstart.com/2009/07/10/configuring-rcp-applications-with-pax-confman/
 .  I have a problem though. Some of the logging is occuring correctly (i.e. I 
can the log4j properties are being applied (log format, appending to file)) and 
yet other log entries are only going to the console.

The log entries that are working include:

Eclipse/OSGI framework logging, e.g:

13:55:41,063 '-DAN-' Framework Event Dispatcher [DEBUG ] 
org.ops4j.pax.logging.pax-logging-service: BundleEvent STARTED
13:55:41,079 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.core.runtime: ServiceEvent REGISTERED
13:55:41,110 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.preferences: ServiceEvent REGISTERED
13:55:41,110 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.preferences: ServiceEvent REGISTERED
13:55:41,110 '-DAN-' Framework Event Dispatcher [DEBUG ] 
org.eclipse.equinox.preferences: BundleEvent STARTED
13:55:41,125 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.core.jobs: ServiceEvent REGISTERED
13:55:41,125 '-DAN-' Framework Event Dispatcher [DEBUG ] org.eclipse.core.jobs: 
BundleEvent STARTED
13:55:41,329 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.registry: ServiceEvent REGISTERED
13:55:41,329 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.registry: ServiceEvent REGISTERED
13:55:41,329 '-DAN-' Framework Event Dispatcher [DEBUG ] 
org.eclipse.equinox.registry: BundleEvent STARTED
13:55:41,344 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.app: ServiceEvent REGISTERED
13:55:41,344 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.app: ServiceEvent REGISTERED
13:55:41,344 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.app: ServiceEvent MODIFIED
13:55:41,344 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.app: ServiceEvent MODIFIED
13:55:41,344 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.app: ServiceEvent REGISTERED
13:55:41,360 '-DAN-' Start Level Event Dispatcher [DEBUG ] 
org.eclipse.equinox.app: ServiceEvent REGISTERED
13:55:41,360 '-DAN-' Framework Event Dispatcher [DEBUG ] 
org.eclipse.equinox.app: BundleEvent STARTED
13:55:41,360 '-DAN-' Framework Event Dispatcher [DEBUG ] 
org.eclipse.core.runtime: BundleEvent STARTED
13:55:41,360 '-DAN-' Framework Event Dispatcher [DEBUG ] 
org.eclipse.osgi.services: BundleEvent STARTED
13:55:41,360 '-DAN-' Framework Event Dispatcher [DEBUG ] org.eclipse.osgi: 
BundleEvent STARTED
13:55:41,360 '-DAN-' Framework Event Dispatcher [DEBUG ] org.eclipse.osgi: 
FrameworkEvent STARTED
13:55:41,360 '-DAN-' Framework Event Dispatcher [DEBUG ] org.eclipse.osgi: 
FrameworkEvent STARTLEVEL CHANGED
13:55:41,360 '-DAN-' main       [DEBUG ] org.eclipse.osgi: ServiceEvent 
REGISTERED
...
...


log4j entries made by a library that has been wrapped and exposed as an OSGI 
bundle and by some core java classes:

13:59:33,785 '-DAN-' Timer-0    [DEBUG ] com.jpmorgan.fasttrade.view.client: 
Picking up events with client poll interval of 100ms
13:59:33,785 '-DAN-' QD:VUM_Dispatcher:0 [DEBUG ] 
com.jpmorgan.fasttrade.view.common: VUM : UpdateFromRootTask start()
13:59:33,785 '-DAN-' COV-EventProcessorAndDispatcher [DEBUG ] 
com.jpmorgan.fasttrade.view.client: COV getchanges : nodeId=-1, blockFor=-1
13:59:33,785 '-DAN-' QD:VUM_Dispatcher:0 [DEBUG ] 
com.jpmorgan.fasttrade.view.common: VUM : updateFromRoot()
13:59:33,785 '-DAN-' QD:VUM_Dispatcher:0 [DEBUG ] 
com.jpmorgan.fasttrade.view.common: VUM : updateFromNode() n=VN view=[null] 
avg=0 times=[0, 0, 0, 0, 0]
13:59:33,785 '-DAN-' COV-EventProcessorAndDispatcher [DEBUG ] 
com.jpmorgan.fasttrade.view.client: COV : notifyChanges() : changes.size=0
13:59:33,785 '-DAN-' QD:VUM_Dispatcher:0 [DEBUG ] 
com.jpmorgan.fasttrade.view.common: update total : 0 ms
13:59:33,785 '-DAN-' QD:VUM_Dispatcher:0 [DEBUG ] 
com.jpmorgan.fasttrade.view.common: VUM : UpdateFromRootTask finish()
13:59:33,785 '-DAN-' Timer-0    [DEBUG ] sun.rmi.transport.tcp: Timer-0: reuse 
connection
13:59:33,785 '-DAN-' Timer-0    [DEBUG ] sun.rmi.loader: Timer-0: name = 
"java.util.ArrayList", codebase = "", defaultLoader = 
org.eclipse.osgi.internal.baseadaptor.defaultclassloa...@2a5ab9
13:59:33,785 '-DAN-' Timer-0    [DEBUG ] sun.rmi.client.ref: Timer-0: free 
connection (reuse = true)
13:59:33,785 '-DAN-' Timer-0    [DEBUG ] sun.rmi.transport.tcp: Timer-0: reuse 
connection


However when I try to log to a Log4J logger in some other plugins I see entries 
on the console like:

[com.jpmorgan.marble.oms.shared.ui.AbstractT2ConnectedActivator] : Log4j About 
to request T2ServiceReference...
[com.jpmorgan.marble.oms.trading.ui.orderblotter.OriginatedOrderBlotterView] : 
Tuple initialisation complete, loaded data for table


Clearly these log entries are making it to the console (must be via pax-logging 
as I don't have log4j anywhere) - however the pax-logging from that plugin 
doesn't seem to be configured like it is in other places. I'm confused as to 
what could cause this - can anyone suggest next steps to investigate?  I have 
checked the following:

- No logging libraries in target platform other than pax-logging

- configuration specifies auto start values:

<configurations>
      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.cm<http://org.eclipse.equinox.cm>" 
autoStart="true" startLevel="1" />
      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
      <plugin id="org.eclipse.osgi.services" autoStart="true" startLevel="0" />
      <plugin id="org.ops4j.pax.configmanager" autoStart="true" startLevel="2" 
/>
      <plugin id="org.ops4j.pax.logging.pax-logging-service" autoStart="true" 
startLevel="2" />
 </configurations>


Hope you can help,

Many thanks,
Dan Pollitt

This email is confidential and subject to important disclaimers and conditions 
including on offers for the purchase or sale of securities, accuracy and 
completeness of information, viruses, confidentiality, legal privilege, and 
legal entity disclaimers, available at 
http://www.jpmorgan.com/pages/disclosures/email.

_______________________________________________
general mailing list
[email protected]<mailto:[email protected]>
http://lists.ops4j.org/mailman/listinfo/general


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to