0
我們使用RollingFlatFileTraceListener在Web項目:RollingFlatFileTraceListener導致NotSupportedException異常
如果監聽嘗試翻轉到一個新的文件,我們得到了一個NotSupportedException異常。
NAME = 「SeguridadFileListener」
fileName="C:\Logs\Portal2015\Seguridad.log"
footer="----------------------"
formatter="TimeStampAndMessage Formatter"
header=""
rollFileExistsBehavior="Overwrite"
rollInterval="None"
rollSizeKB="2048"
timeStampPattern="yyyy-MM-dd HH:mm"
traceOutputOptions="None"
filter="All"
我們猜測,在文件名失蹤的路徑信息屬性導致總得無效的路徑(?網頁URL記號),細節是這樣的:
異常信息詳情:
Exception Type: System.NotSupportedException
Message: The given path's format is not supported.
Data: System.Collections.ListDictionaryInternal
TargetSite: System.String CanonicalizePath(System.String, Boolean)
HelpLink: NULL
Source: mscorlib
堆棧跟蹤信息詳情:
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
,然後嫌我得到這個錯誤:
Exception Type: System.NullReferenceException
Message: Referencia a objeto no establecida como instancia de un objeto.
Data: System.Collections.ListDictionaryInternal
TargetSite: Void PerformRoll(System.DateTime)
HelpLink: NULL
Source: Microsoft.Practices.EnterpriseLibrary.Logging
HResult: -2147467261
堆棧跟蹤信息詳情:
en Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.StreamWriterRollingHelper.PerformRoll(DateTime rollDateTime)
en Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.StreamWriterRollingHelper.RollIfNecessary()
en Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
en Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.TraceListenerWrapper.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
en Microsoft.Practices.EnterpriseLibrary.Logging.LogSource.TraceData(TraceEventType eventType, Int32 id, LogEntry logEntry, TraceListenerFilter traceListenerFilter, TraceEventCache traceEventCache)
en Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterImpl.ProcessLog(LogEntry log, TraceEventCache traceEventCache)
有什麼建議?