mono/mono — pull request #304 by crazyjncsu (2012-05-25 15:31:43+00:00)
Title: Disabling WCF log activity when logging is disabled by configuration

The System.ServiceModel.Logger static methods are used by all of the various channel classes throughout WCF.

Until they previous commit they were not thread-safe at all. Basic usage of WCF would bring down the entire process because access to the single XmlWriter wasn't synchronized.

The last commit synchronized access, but across the entire AppDomain, which is not desirable from a performance perspective.

Under default behavior the Logger is performing a lot of activity, then writing to TextWriter.Null. I changed the default behavior to not instantiate a text writer at all if logging isn't configured and to not even enter blocks where previously a lot of intensive logging activity was performed