On 31/08/2015 19:52, Christopher Schultz wrote:
Mike,

On 8/31/15 1:48 PM, Mike Kienenberger wrote:
Read the whole thread.
Yeah, I'm catching-up now.

My understanding is that serialization of static commons-logging was
the original problem needing fixed. slf4j doesn't have that issue.
I didn't think that static members were serialized. I suppose it depends
upon how the logging framework is being used. I rarely if ever use
non-static logging references, but of course I can't control everyone
else's coding styles :)

Yes, the problem is the serialization of non-static members. Christopher, if you use Velocity, you do use non-static logging references, at least indirectly, since Velocity does use them :-)

Static logging has the merit of simplicity, I often use it, but it poses several limits. Using loggers injection has many advantages, like allowing separate Velocity instances to use distinct loggers (note that there are dirty classloader tricks to try to do that with static references, which we don't want), allowing loggers mocking and capturing features for testcases, better control over initialization order, and certainly other advantages.


  Claude

-chris



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to