<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 19, 2009, at 2:15 PM, Ceki Gulcu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Ralph Goers wrote:<br><blockquote type="cite"><blockquote type="cite">* The provision of the Locale should be an orthogonal concept to the logging of messages and the creation of the Logger. This should be handled via the MDC.<br></blockquote></blockquote><blockquote type="cite">"could be handled via the MDC". There are other ways to do it but that is probably the simplest.<br></blockquote><br>Pushing the locale in every thread will not suite everyone.<br></div></blockquote><div><br></div>Probably not. In those cases the method you described before using the LoggerContext would probably work. </div><div><br></div><div>But it depends on the use case. In a lot of systems the operations staff will want all the log messages in a single language of the locale where the software is running and the locale of the end user will be irrelevant. In cases like event logging it may be that the event logs are viewed by customer service reps speaking in multiple languages. In that case the locale of the person viewing the log is important (which may be days or months after the log entry was recorded). The least critical scenario, in my opinion, is where the log entry will be viewed by the end user. IMO this isn't the best use of a logging system.</div><div>OTOH, in my case we would still put the locale of the end user in the MDC simply because other GUI components will want that information.</div><div><br></div><div><blockquote type="cite"><div><br><blockquote type="cite"><blockquote type="cite">IMO there are still a few questions to answer:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">* Takeshi original design allowed you to use Enums as keys for messages. I'm personally not sure about this, I'm not really sure what benefits it offers over Strings as keys<br></blockquote></blockquote><blockquote type="cite">Enums are usually associated with an integer "value" and a String description. The only value is that you might be able to get some optimization by using the integer value of the enum in some cases. I don't know that it is worth the effort to support it.<br></blockquote><br>Unless enums have some other advantage that we did not think of. Takeshi can you describe the advantages of enums that you see?<br><br><blockquote type="cite"><blockquote type="cite">* How does a framework provide translated messages [1] to i8ln layer? Can we also use the MDC here to push them in, and have the appender read them?<br></blockquote></blockquote><blockquote type="cite">I'm not sure I understand the question. The framework will provide a method like:<br></blockquote><blockquote type="cite">public String getMessage(String key, Object[] params);<br></blockquote><blockquote type="cite">However the messages are stored is hidden behind the implementation of that interface. Something has to call getMessage(). Potential places are a) the application before calling SLF4J b) SLF4J before calling a logging implementation, c) In the logging implementation - such as in the Appender.<br></blockquote><br>Bingo. a), b) or c) is the question. There is also a) and b) combined. See my previous message.<br><br><blockquote type="cite">Again, that depends. For example, Lillith (<a href="http://freshmeat.net/projects/lilith-viewer">http://freshmeat.net/projects/lilith-viewer</a>) is an event viewer for Logback. It would be very appropriate for it to do this. Likewise with Apache Chainsaw for Log4j. Doing the L10N further up the chain limits the flexibility these tools can provide. Sometimes that is desirable, but my recommendation is to always start from as far back as possible and move up the stack only as far as you have to.<br></blockquote><br>If SLF4J or logback provided a reasonable solution, it would help developers in solving the logging i18n issue by the mere fact of offering and thus blessing a solution. It could only do harm if the offered solution was particularly stupid or bad. Moreover, the solution provided in slf4j or logback (or in both in part) could lay the foundation of a better solution imagined by one of our users.<font class="Apple-style-span" color="#006312"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>+1. That is why we would want to consider several use cases. I don't think there is a one size fits all solution.</div><div><br></div><div>Ralph</div><br></body></html>