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" 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]
http://lists.ops4j.org/mailman/listinfo/general