avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Mortenson <l...@tanukisoftware.com>
Subject [Commit] Reworked the logging in Fortress
Date Wed, 07 Aug 2002 04:56:06 GMT
I just committed a buch of changes which make it possible to configure 
the log output of Fortress
to a much greater degree.   This was done by assigning unique categories 
to the various objects
which make up the Fortress system.

Here is a table of the new logger categories as seen from the swing 
example.  (Note that these are all
prefixed by the "fortress" category because that prefix is set for the 
defaultContext LOG_CATEGORY
in ContextBuilder)

fortress                                            Root category 
defined by the LOG_CATEGORY
fortress.translator                             Log output from the 
translator service.  Specified in the xconf conf file for the service.
fortress.system                                 Root category for all 
internal system categories
fortress.system.logkit                        Log output from the 
fortress.system.roles                         Log output from the 
fortress.system.roles.defaults             Log output from the 
fortress.system.threadmgr                 Log output from the ThreadManager
fortress.system.factory                      Log output from the 
ComponentFactory  (Already existed)
fortress.system.handler                      Root category for all 
handler categories.  (Already existed)
fortress.system.handler.factory          Log output from the 
FactoryComponentHandler  (Already existed)
fortress.system.handler.perthread      Log output from the 
PerThreadComponentHandler  (Already existed)
fortress.system.handler.poolable        Log output from the 
PoolableComponentHandler  (Already existed)
fortress.system.handler.threadsafe      Log output from the 
ThreadSafeComponentHandler  (Already existed)
fortress.system.instrument                  Log output from the 
InstrumentManager (if present)
fortress.system.instrument.connector  Log output from the connectors of 
the InstrumentManager (Defined by InstrumentManager)
fortress.system.instrument.values        Log detailed output of values 
passed to the InstrumentManager (Defined by InstrumentManager)

At first glance, this may seem like a lot of categories.  But it has the 
benefit of making it very easy to
see the exact information that the user is interrested in.

For example.  Most users will set the following categories in their xlog 
conf file.  This will only output
information from the root category and the categories of their services. 
 All system debug output is
      <!-- Log output from the default logger -->
      <category name="" log-level="DEBUG">
        <log-target id-ref="console"/>

      <!-- Log output from the fortress system -->
      <category name="system" log-level="INFO">
        <log-target id-ref="console"/>

By creating subcatories under the system configuration, specific log 
output can be selected and displayed:
      <!-- Log output from the default logger -->
      <category name="" log-level="DEBUG">
        <log-target id-ref="console"/>

      <!-- Log output from the fortress system -->
      <category name="system" log-level="INFO">
        <log-target id-ref="console"/>

        <!-- Log output from the component factory -->
        <category name="factory" log-level="DEBUG">
          <log-target id-ref="console"/>

The log output from the actual LogKitLoggerManager is handled slightly 
differently.   Its log priority is
set via an attribute in the top level of the xlog conf file:
<logkit log-level="INFO">
This value defaults to "DEBUG".   The format can not be controlled until 
the xlog conf file has been
loaded.  But the format will be set to what is specified in the conf 
file as it is loaded.

In addition, you have the ability to configure the names of certain 
loggers from their respecive conf files
using a "logger" attribute much like was done with the "log-level" 
attribute above.  Below are all the
places were logger categories can be specified along with their default 

  <logkit logger="system.logkit">

  <fortress-roles logger="system.roles">

  <instrument logger="system.instrument">

I have not yet played around with nesting contexts, so hopefully this 
all fits together nicely.


To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

View raw message