The YAAFI container expects that you setup the logging facilty to be used. The Avalon Service Framework provides wrappers for commonly used loggers such as
The following examples shows how to use a Log4J logger assuming that the configuration is located in the "conf" directory and tells Log4J to monitor the configuration file to detect changes of the trace level.
Main cli = new Main(args) String log4jConfig = cli.makeAbsolutePath( System.getProperty("log4j.configuration", "./conf/log4j.properties") ); PropertyConfigurator.configureAndWatch( log4jConfig, 2000 ); cli.setLogger( new Log4JLogger( Logger.getLogger("main") ) );
Using an Avalon container requires your application to lookup services during runtime. This functionality is exposed through the "ServiceManager" interface. The real question is how to get hold of a "ServiceManager" interface without polluting the whole application with Avalon dependencies. Unfortunately there is no simple answer to that
A reconfiguration can be triggered by your application code or by the ReconfigurationService which monitors the component configuration file.