On Aug 13, 3:37 pm, Kamil Demecki <
skajo...@gmail.com> wrote:
> It is generic problem. IoC framework should permit to lately override
> some specific behavior. At first time I dont now which log/something
> implementation is good, In case of Logger.getLogger you are tied with
> one solution. If you wont introduce fasade
> youloggingfacase.getLogger() and then you must change logging/
> something funtionality you have two solutions:
>
> 1) find all occurencess Log.getLogger()
> 2) write you own Log.getLogger and push it first on classpath
>
> I would like IoC framework give nice solution ;)
Log.getLogger() is already providing a way to utilize several
different logging implementations - it's essentially doing injection
already. The inherent problem is that none of these logging
structures implement identical interfaces for doing logging, therefore
to inject them you need to either inject a wrapper interface like
Commons Logging or slf4j or write your own (blech). If you're using
the wrapper directly you're already getting the ability to swap
implementations in and out and all you're adding by doing an injection
step is another maintenance point, adding the logging to your Guice
modules AND maintaining the wrapper configs.