net-commons / common-logging

A portable logging abstraction for .NET
http://net-commons.github.io/common-logging
Apache License 2.0
649 stars 205 forks source link

[EntLib60] InvalidOperationException: The LogWriter is already set. #162

Open icnocop opened 6 years ago

icnocop commented 6 years ago

Hi.

Thank you for Common.Logging.

If the log writer is already set externally, and an HTTP POST is sent to "/jsnlog.logger" for example, the following error occurs:

[InvalidOperationException]: The LogWriter is already set.
   at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.SetLogWriter(LogWriter logWriter, Boolean throwIfSet)
   at Common.Logging.EntLib.EntLibLoggerFactoryAdapter.GetWriter() in C:\_oss\common-logging\src\Common.Logging.EntLib60\Logging\EntLib\EntLibLoggerFactoryAdapter.cs:line 115
   at Common.Logging.EntLib.EntLibLoggerFactoryAdapter.get_LogWriter() in C:\_oss\common-logging\src\Common.Logging.EntLib60\Logging\EntLib\EntLibLoggerFactoryAdapter.cs:line 101
   at Common.Logging.EntLib.EntLibLoggerFactoryAdapter.CreateLogger(String name) in C:\_oss\common-logging\src\Common.Logging.EntLib60\Logging\EntLib\EntLibLoggerFactoryAdapter.cs:line 164
   at Common.Logging.Factory.AbstractCachingLoggerFactoryAdapter.GetLoggerInternal(String key) in C:\_oss\common-logging\src\Common.Logging.Portable\Logging\Factory\AbstractCachingLoggerFactoryAdapter.cs:line 116
   at Common.Logging.Factory.AbstractCachingLoggerFactoryAdapter.GetLogger(String key) in C:\_oss\common-logging\src\Common.Logging.Portable\Logging\Factory\AbstractCachingLoggerFactoryAdapter.cs:line 97
   at JSNLog.LogHandling.CommonLoggingAdapter.Log(FinalLogData finalLogData)
   at JSNLog.LogHandling.LoggerProcessor.ProcessLogRequest(String json, LogRequestBase logRequestBase, DateTime serverSideTimeUtc, String httpMethod, String origin, LogResponse response)
   at JSNLog.LoggerHandler.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)