Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » (no subject)
(no subject) [message #713735] Mon, 08 August 2011 23:02 Go to next message
Goetz Botterweck is currently offline Goetz BotterweckFriend
Messages: 71
Registered: July 2009
Member
Hi,

when debugging applications based on CDO (incl. the Hibernate Store) the
logging output can be a bit overwhelming.

How and where can I control the logging output generated by CDO and Net4J?

What are good strategies to keep the logging output of your own app
separate from the logging output generated by the underlying frameworks?

Thanks,
Goetz
(no subject) [message #713817 is a reply to message #713735] Tue, 09 August 2011 06:14 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 09.08.2011 01:02, schrieb Goetz Botterweck:
> Hi,
>
> when debugging applications based on CDO (incl. the Hibernate Store) the
> logging output can be a bit overwhelming.
Our Operations & Maintenance (OM) platform distinguishes between logging important events and tracing debug
informations. While log events can not be suppressed, traces can be configured in a fine grained manner through the
normal OSGi mechanisms, e.g., the Tracing tab of a launch configuration or the .options file of a product.

*But*: Both log and (enabled) trace events can be handled in custom ways by adding or removing OMLogHandlers and
OMTraceHandlers to/from the OMPlatform.INSTANCE:

org.eclipse.net4j.util.om.OMPlatform.isDebugging()
org.eclipse.net4j.util.om.OMPlatform.setDebugging(boolean)
org.eclipse.net4j.util.om.OMPlatform.addLogHandler(OMLogHandler)
org.eclipse.net4j.util.om.OMPlatform.removeLogHandler(OMLogHandler)
org.eclipse.net4j.util.om.OMPlatform.addTraceHandler(OMTraceHandler)
org.eclipse.net4j.util.om.OMPlatform.removeTraceHandler(OMTraceHandler)

You can easily remove the default org.eclipse.net4j.util.om.trace.PrintTraceHandler.CONSOLE and/or add a custom trace
handler that writes traces to a file:

org.eclipse.net4j.util.om.trace.PrintTraceHandler.PrintTraceHandler(PrintStream)

BTW., OMPlatform.INSTANCE.setDebugging(false) disables trace events altogether.

Please also note that all OM facilities (logging, tracing, monitoring, preferences, etc.) work with or without OSGi.
That's the whole purpose of the OM framework.

> How and where can I control the logging output generated by CDO and Net4J?
>
> What are good strategies to keep the logging output of your own app
> separate from the logging output generated by the underlying frameworks?
You should write and register your own trace handlers with the OMPlatform and possibly remove the default one.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


(no subject) [message #714080 is a reply to message #713817] Tue, 09 August 2011 18:03 Go to previous messageGo to next message
Goetz Botterweck is currently offline Goetz BotterweckFriend
Messages: 71
Registered: July 2009
Member
Hi Eike,

thanks for the hints. I made some progress, but still keep getting too
much logging output.

For context: I am using CDO with the Hibernate Store. So this might also
be a question for Martin Taal.


Here is what I tried to get rid of the logging output:

1) I imported the net4j projects as source, found the .options files and
reconfigured the debug options to "false".

2) When starting the CDO Hibernate Server I switch tracing off in the
launch configuration.

3) In my application, which is acting as a CDO client, I inserted
OMPlatform.INSTANCE.setDebugging(false);

However, I keep getting logging output. I am pasting examples below.

Any hints where I could look?

There are some parts in the application that are using log4j so I
suspected that output might be coming from there, but reconfiguring the
log4j.properties file did not make any difference.

Thanks,
Goetz

--------------------- logging output ------------------------
main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating
ManagedContainer
main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating {}
main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP
PluginFactoryRegistry@1
Registry.autoCommit = true
Registry.transaction = null
HashMapRegistry.map =
extensionRegistryListener = null

main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating []
main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP
PluginElementProcessorList@2
processors =
extensionRegistryListener = null

main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP PluginContainer@3
ManagedContainer.factoryRegistry =
ManagedContainer.postProcessors =
ManagedContainer.elementRegistry =

main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating
ManagedContainer
main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating
{org.eclipse.net4j.acceptors[tcp]=Factory[org.eclipse.net4j.acceptors,
tcp],
org.eclipse.net4j.connectors[tcp]=Factory[org.eclipse.net4j.connectors,
tcp],
org.eclipse.net4j.randomizers[default]=Factory[org.eclipse.net4j.randomizers,
default],
org.eclipse.net4j.clientProtocols[cdo]=Factory[org.eclipse.net4j.clientProtocols,
cdo],
org.eclipse.net4j.userManagers[file]=Factory[org.eclipse.net4j.userManagers,
file],
org.eclipse.net4j.executorServices[default]=Factory[org.eclipse.net4j.executorServices,
default],
org.eclipse.net4j.serverProtocols[heartbeat]=Factory[org.eclipse.net4j.serverProtocols,
heartbeat],
org.eclipse.net4j.selectors[tcp]=Factory[org.eclipse.net4j.selectors,
tcp],
org.eclipse.net4j.util.timers[daemon]=Factory[org.eclipse.net4j.util.timers,
daemon],
org.eclipse.emf.cdo.sessions[cdo]=Factory[org.eclipse.emf.cdo.sessions,
cdo],
org.eclipse.net4j.bufferProviders[default]=Factory[org.eclipse.net4j.bufferProviders,
default]}
main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP HashMapRegistry@4
Registry.autoCommit = true
Registry.transaction = null
map =

org.eclipse.net4j.acceptors[tcp]=Factory[org.eclipse.net4j.acceptors, tcp]

org.eclipse.net4j.connectors[tcp]=Factory[org.eclipse.net4j.connectors, tcp]

org.eclipse.net4j.randomizers[default]=Factory[org.eclipse.net4j.randomizers,
default]

org.eclipse.net4j.clientProtocols[cdo]=Factory[org.eclipse.net4j.clientProtocols,
cdo]

org.eclipse.net4j.userManagers[file]=Factory[org.eclipse.net4j.userManagers,
file]

org.eclipse.net4j.executorServices[default]=Factory[org.eclipse.net4j.executorServices,
default]

org.eclipse.net4j.serverProtocols[heartbeat]=Factory[org.eclipse.net4j.serverProtocols,
heartbeat]



..... and so on ......
(no subject) [message #714243 is a reply to message #714080] Wed, 10 August 2011 06:29 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Goetz,

The traces (not logs) definitely come from Net4j and CDO. So you must have made a mistake when you tried to disable
them. I recommend to set breakpoints at your OMPlatform.INSTANCE.setDebugging(false) statement and some of the
TRACER.trace() calls, e.g., in org.eclipse.net4j.util.lifecycle.Lifecycle.

Note that yo udon't necessarily need the sources to change the tracing options.
http://wiki.eclipse.org/FAQ_How_do_I_use_the_platform_debug_tracing_facility%3F says:

"Finally, you need to enable the tracing mechanism by starting Eclipse with the -debug command line argument. You can,
optionally, specify the location of the debug options file as either a URL or a file-system path after the -debug
argument. "

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper





Am 09.08.2011 20:03, schrieb Goetz Botterweck:
> Hi Eike,
>
> thanks for the hints. I made some progress, but still keep getting too
> much logging output.
>
> For context: I am using CDO with the Hibernate Store. So this might also
> be a question for Martin Taal.
>
>
> Here is what I tried to get rid of the logging output:
>
> 1) I imported the net4j projects as source, found the .options files and
> reconfigured the debug options to "false".
>
> 2) When starting the CDO Hibernate Server I switch tracing off in the
> launch configuration.
>
> 3) In my application, which is acting as a CDO client, I inserted
> OMPlatform.INSTANCE.setDebugging(false);
>
> However, I keep getting logging output. I am pasting examples below.
>
> Any hints where I could look?
>
> There are some parts in the application that are using log4j so I
> suspected that output might be coming from there, but reconfiguring the
> log4j.properties file did not make any difference.
>
> Thanks,
> Goetz
>
> --------------------- logging output ------------------------
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating
> ManagedContainer
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating {}
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP
> PluginFactoryRegistry@1
> Registry.autoCommit = true
> Registry.transaction = null
> HashMapRegistry.map =
> extensionRegistryListener = null
>
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating []
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP
> PluginElementProcessorList@2
> processors =
> extensionRegistryListener = null
>
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP PluginContainer@3
> ManagedContainer.factoryRegistry =
> ManagedContainer.postProcessors =
> ManagedContainer.elementRegistry =
>
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating
> ManagedContainer
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating
> {org.eclipse.net4j.acceptors[tcp]=Factory[org.eclipse.net4j.acceptors,
> tcp],
> org.eclipse.net4j.connectors[tcp]=Factory[org.eclipse.net4j.connectors,
> tcp],
> org.eclipse.net4j.randomizers[default]=Factory[org.eclipse.net4j.randomizers,
> default],
> org.eclipse.net4j.clientProtocols[cdo]=Factory[org.eclipse.net4j.clientProtocols,
> cdo],
> org.eclipse.net4j.userManagers[file]=Factory[org.eclipse.net4j.userManagers,
> file],
> org.eclipse.net4j.executorServices[default]=Factory[org.eclipse.net4j.executorServices,
> default],
> org.eclipse.net4j.serverProtocols[heartbeat]=Factory[org.eclipse.net4j.serverProtocols,
> heartbeat],
> org.eclipse.net4j.selectors[tcp]=Factory[org.eclipse.net4j.selectors,
> tcp],
> org.eclipse.net4j.util.timers[daemon]=Factory[org.eclipse.net4j.util.timers,
> daemon],
> org.eclipse.emf.cdo.sessions[cdo]=Factory[org.eclipse.emf.cdo.sessions,
> cdo],
> org.eclipse.net4j.bufferProviders[default]=Factory[org.eclipse.net4j.bufferProviders,
> default]}
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP HashMapRegistry@4
> Registry.autoCommit = true
> Registry.transaction = null
> map =
>
> org.eclipse.net4j.acceptors[tcp]=Factory[org.eclipse.net4j.acceptors, tcp]
>
> org.eclipse.net4j.connectors[tcp]=Factory[org.eclipse.net4j.connectors, tcp]
>
> org.eclipse.net4j.randomizers[default]=Factory[org.eclipse.net4j.randomizers,
> default]
>
> org.eclipse.net4j.clientProtocols[cdo]=Factory[org.eclipse.net4j.clientProtocols,
> cdo]
>
> org.eclipse.net4j.userManagers[file]=Factory[org.eclipse.net4j.userManagers,
> file]
>
> org.eclipse.net4j.executorServices[default]=Factory[org.eclipse.net4j.executorServices,
> default]
>
> org.eclipse.net4j.serverProtocols[heartbeat]=Factory[org.eclipse.net4j.serverProtocols,
> heartbeat]
>
>
>
> .... and so on ......


(no subject) [message #714248 is a reply to message #714080] Wed, 10 August 2011 06:29 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Goetz,

The traces (not logs) definitely come from Net4j and CDO. So you must have made a mistake when you tried to disable
them. I recommend to set breakpoints at your OMPlatform.INSTANCE.setDebugging(false) statement and some of the
TRACER.trace() calls, e.g., in org.eclipse.net4j.util.lifecycle.Lifecycle.

Note that yo udon't necessarily need the sources to change the tracing options.
http://wiki.eclipse.org/FAQ_How_do_I_use_the_platform_debug_tracing_facility%3F says:

"Finally, you need to enable the tracing mechanism by starting Eclipse with the -debug command line argument. You can,
optionally, specify the location of the debug options file as either a URL or a file-system path after the -debug
argument. "

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper





Am 09.08.2011 20:03, schrieb Goetz Botterweck:
> Hi Eike,
>
> thanks for the hints. I made some progress, but still keep getting too
> much logging output.
>
> For context: I am using CDO with the Hibernate Store. So this might also
> be a question for Martin Taal.
>
>
> Here is what I tried to get rid of the logging output:
>
> 1) I imported the net4j projects as source, found the .options files and
> reconfigured the debug options to "false".
>
> 2) When starting the CDO Hibernate Server I switch tracing off in the
> launch configuration.
>
> 3) In my application, which is acting as a CDO client, I inserted
> OMPlatform.INSTANCE.setDebugging(false);
>
> However, I keep getting logging output. I am pasting examples below.
>
> Any hints where I could look?
>
> There are some parts in the application that are using log4j so I
> suspected that output might be coming from there, but reconfiguring the
> log4j.properties file did not make any difference.
>
> Thanks,
> Goetz
>
> --------------------- logging output ------------------------
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating
> ManagedContainer
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating {}
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP
> PluginFactoryRegistry@1
> Registry.autoCommit = true
> Registry.transaction = null
> HashMapRegistry.map =
> extensionRegistryListener = null
>
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating []
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP
> PluginElementProcessorList@2
> processors =
> extensionRegistryListener = null
>
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP PluginContainer@3
> ManagedContainer.factoryRegistry =
> ManagedContainer.postProcessors =
> ManagedContainer.elementRegistry =
>
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating
> ManagedContainer
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Activating
> {org.eclipse.net4j.acceptors[tcp]=Factory[org.eclipse.net4j.acceptors,
> tcp],
> org.eclipse.net4j.connectors[tcp]=Factory[org.eclipse.net4j.connectors,
> tcp],
> org.eclipse.net4j.randomizers[default]=Factory[org.eclipse.net4j.randomizers,
> default],
> org.eclipse.net4j.clientProtocols[cdo]=Factory[org.eclipse.net4j.clientProtocols,
> cdo],
> org.eclipse.net4j.userManagers[file]=Factory[org.eclipse.net4j.userManagers,
> file],
> org.eclipse.net4j.executorServices[default]=Factory[org.eclipse.net4j.executorServices,
> default],
> org.eclipse.net4j.serverProtocols[heartbeat]=Factory[org.eclipse.net4j.serverProtocols,
> heartbeat],
> org.eclipse.net4j.selectors[tcp]=Factory[org.eclipse.net4j.selectors,
> tcp],
> org.eclipse.net4j.util.timers[daemon]=Factory[org.eclipse.net4j.util.timers,
> daemon],
> org.eclipse.emf.cdo.sessions[cdo]=Factory[org.eclipse.emf.cdo.sessions,
> cdo],
> org.eclipse.net4j.bufferProviders[default]=Factory[org.eclipse.net4j.bufferProviders,
> default]}
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] DUMP HashMapRegistry@4
> Registry.autoCommit = true
> Registry.transaction = null
> map =
>
> org.eclipse.net4j.acceptors[tcp]=Factory[org.eclipse.net4j.acceptors, tcp]
>
> org.eclipse.net4j.connectors[tcp]=Factory[org.eclipse.net4j.connectors, tcp]
>
> org.eclipse.net4j.randomizers[default]=Factory[org.eclipse.net4j.randomizers,
> default]
>
> org.eclipse.net4j.clientProtocols[cdo]=Factory[org.eclipse.net4j.clientProtocols,
> cdo]
>
> org.eclipse.net4j.userManagers[file]=Factory[org.eclipse.net4j.userManagers,
> file]
>
> org.eclipse.net4j.executorServices[default]=Factory[org.eclipse.net4j.executorServices,
> default]
>
> org.eclipse.net4j.serverProtocols[heartbeat]=Factory[org.eclipse.net4j.serverProtocols,
> heartbeat]
>
>
>
> .... and so on ......


Previous Topic:GEF - images
Next Topic:[CDO] Ganymede CDO with Derby and Hibernate
Goto Forum:
  


Current Time: Sat Apr 27 01:49:51 GMT 2024

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

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

Back to the top