You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Jon Maron <jo...@oracle.com> on 2006/02/09 15:34:57 UTC
Enabling logging
Hi,
My attempts to enable logging thru system properties and the
tuscany-logging.properties file have failed. How exactly does one enable
logging?
-- Jon
Re: Enabling logging
Posted by Jeremy Boynes <jb...@apache.org>.
Jon Maron wrote:
> Hi,
>
> My attempts to enable logging thru system properties and the
> tuscany-logging.properties file have failed. How exactly does one enable
> logging?
>
We're not using traditional clogging style logging in the main core.
Instead we intend to use a monitoring style of instrumentation where
each component can have a dependency on a monitor interface whose
implementation will be supplied by the SCA container. This applies to
system components as well as user ones.
See
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/common/src/main/java/org/apache/tuscany/common/monitor/
To create these implementations the container framework uses an
implementation of a MonitorFactory which ultimately will be instantiated
as part of container bootstrap. Currently this has to be passed into the
TuscanyRuntime and if this is not done a NullMonitorFactory is used
which swallows all monitor events.
We do have a basic implementation of MonitorFactory that delegates to
the java.util.logging framework which you can enable with something like:
Properties props = new Properties();
// ... load class#method=LEVEL values e.g. from resource
MonitorFactory mf = new JavaLoggingMonitorFactory(
props,
Level.DEBUG,
"path/to/bundle"
);
TuscanyRuntime rt = new TuscanyRuntime("myModule", "uri", mf);
To preempt the question "why not clogging?" ...
* it has a few issues
e.g http://www.qos.ch/logging/classloader.jsp
* we wanted to abstract message generation out of the main code
* we wanted to allow people to use different logging frameworks
* we wanted to make I18N easier
* we had an IoC container that could handle the work of
providing each component with a suitable monitor
--
Jeremy