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 
LogKitLoggerManager
fortress.system.roles                         Log output from the 
RoleManager
fortress.system.roles.defaults             Log output from the 
ExcaliburRoleManager.
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
disabled.
    <categories>
      <!-- Log output from the default logger -->
      <category name="" log-level="DEBUG">
        <log-target id-ref="console"/>
      </category>

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

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

      <!-- 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"/>
        </category>
      </category>
    </categories>

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">
...
</logkit>
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 
values.

{containerclass}.xlog
  <logkit logger="system.logkit">
    ...
  </logkit>

{containerclass}.roles
  <fortress-roles logger="system.roles">
    ...
  </fortress-roles>

{containerclass}.instrument
  <instrument logger="system.instrument">
    ...
  </instrument>

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

Cheers,
Leif



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


Mime
View raw message