Hi, I am interested in internationalizing my logging messages and I see that I can use the l7dlog() methods on Logger to accomplish this. I am interested only in l7d at the source rather than at the destination so these methods are perfect (i.e. I don't need to do l7d in the appenders). Like several others on this list I would like to be able to easily configure the ResourceBundle that is associated with each Logger. I believe that I can accomplish this by creating a custom LoggerFactory. I want to explain my proposed approach and see if anyone has feedback on it.
I will create a custom LoggerFactory that takes a single parameter - the desired Locale expressed as language code, country code, and variant. When the factory instantiates a new logger it will first call super() which will yield a new Logger object. I am planning to use the package structure to define my loggers and I will call ResourceBundle.getBundle(loggerName, locale) with the logger name and the supplied locale (or without the locale if none is provided). When I obtain the ResourceBundle I will assign it to the Logger using Logger.setResourceBundle(). If I get fancy I may search for a ResourceBundle higher up in the package structure if I don't find one specific to the class (i.e. first look for com.package.MyClass then com.package, then com). Does anyone have any comments or suggestions on this approach? Thanks, Mark --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
