Hi Anton,

Doing only setLoggerManagerConfiguration() doesn't do the trick. Fortress continues to use logkit with some default configuration, I suppose, as my xlog file contains log4j specific configuration. Using setLoggerManager() with preconfigured Log4JLoggerManager doesn't look much different from what I am doing now - configuring log4j directly using PropertyConfigurator. The only difference is that I am not
using LoggerManager interface to perform the configuration. My be it would be better to use this interface although I am not familiar with avalon configuration loading API yet. If I do it like this, will my log files configured in the xlog file be created under the fortress's work directory configured using "FortressConfig.setWorkDirectory()" ?


Regards,
Peter.

Anton Tagunov wrote:

Hello Peter!

Your mail actually falls into two parts.

Part 1.

in FortressConfig you should really do one of

  setLoggerManagerConfiguration()
  setLoggerManager()

if you invoke the later the logger manager should alredy be
configured.

Can you do well with only setLoggerManagerCofiguration()?

Part 2.

I'll naturally leave this to the gurus :-)
My personal feeling is this is a valuable patch ;-)

PS> The second problem I have encountered is that the source file and line
PS> number in error message is always the one from the lone Log4JLogger PS> wrapper makes the call to log4j logger. To fix this you need to pass PS> wrapper's class name to the log4j logger so it knows how to find the PS> caller source. Below is how the fix should be done:


PS> // right now is like this
PS>      public final void debug( final String message )
PS>      {
PS>                 m_logger.debug(message);
PS>      }
PS> // should be
PS>         private static final String FQCN        =       
Log4JLogger.class.getName();

PS>      public final void debug( final String message )
PS>      {
PS>                 m_logger.log(FQCN, Priority.DEBUG, message, null);
PS>      }

PS> I use nighly builds for fortress and other avalon/excalibur projects. It PS> is because fortress wasn't released yet but I've heard that it is the PS> container manager everybody should be moving to.

Well, at least it is what people should be moving to from ECM
(that is org.apache.avalon.excalibur.component).
And it looks like it is the container suggested to start with.

Oh, yes, being the most lightweight it is the recommended container
for embedding into a Servlet application.
(What I'm currently doing myself now :-)

WBR, Anton



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to