Monday Apr 06, 2009

Fuji Milestone 4 has Logger configuration support. Runtime loggers and component loggers can be configured using Fuji admin CLI. Logger Configuration Support in Fuji leverages OSGi ConfigurationAdmin service.

Play with it !!

Download and setup FujiFelix distribution:

    (i)Download the M4 release from Fuji maven repository.
    (ii)Extract it in <FujiHome>
    (iii)cd <FujiHome>; java -jar bin/felix.jar

Listing Runtime Loggers:

    -> fuji list-loggers
    Fuji Runtime Loggers
    -----------------------------------
    com.sun.jbi = INFO
    com.sun.jbi.fuji = INFO
    com.sun.jbi.framework = INFO
    com.sun.jbi.messaging = INFO
    com.sun.jbi.interceptors = INFO
    com.sun.jbi.logging = INFO
    Command list-loggers executed successfully.

Listing Component Loggers:

    Now start a component, example, sun-file-binding
    -> start 20
    -> fuji list-loggers --component sun-file-binding
    Loggers For Component sun-file-binding
    -------------------------------------------------------------
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.OutboundMessageProcessor = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.InboundMessageProcessor = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.management.FileBCManagement = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.FileBindingDeployer = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.bootstrap.FileBindingBootstrap = INFO
    com.sun.jbi.sun-file-binding = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.FileBindingLifeCycle = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.bootstrap.InstallerExt = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.common.qos.messaging.MessagingChannel = INFO
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.RuntimeConfiguration = INFO
    Command list-loggers executed successfully.

Configuring a Runtime Logger:

    -> fuji set-logger com.sun.jbi.messaging=FINEST
    Command set-logger executed successfully.
    -> fuji list-loggers
    Fuji Runtime Loggers
    ----------------------------------
    com.sun.jbi = INFO
    com.sun.jbi.fuji = INFO
    com.sun.jbi.framework = INFO
    com.sun.jbi.messaging = FINEST
    com.sun.jbi.interceptors = INFO
    com.sun.jbi.logging = INFO
    Command list-loggers executed successfully.

Configuring a Component Logger:

    -> fuji set-logger --component sun-file-binding com.sun.jbi.sun-file-binding=FINE
    Command set-logger executed successfully.
    -> fuji list-loggers --component sun-file-binding
    Loggers For Component sun-file-binding
    --------------------------------------
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.OutboundMessageProcessor = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.InboundMessageProcessor = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.management.FileBCManagement = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.FileBindingDeployer = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.bootstrap.FileBindingBootstrap = FINE
    com.sun.jbi.sun-file-binding = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.FileBindingLifeCycle = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.bootstrap.InstallerExt = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.common.qos.messaging.MessagingChannel = FINE
    com.sun.jbi.sun-file-binding.com.sun.jbi.filebc.RuntimeConfiguration = FINE
    Command list-loggers executed successfully.

Component Root logger:

When a JBI component is installed, the framework creates a component root logger with the name "com.sun.jbi.<component-name>". By configuring this component root logger, all other component logger could be configured.

System root logger:

When Fuji framework starts up, it creates a system a root logger with the name "com.sun.jbi". This is the parent logger for all other runtime loggers and component loggers. By changing this logger's level, all other Fuji loggers (that were created with the default level - inherits from parent) can be configured automatically.

More to come:

    (i)Logger configuration support from Netbeans - issue 1599
    (ii)Logger configuration support in Equinox - issue 1600
    (iii)Interceptor logger configuration - issue 1487