私たちはhttps://www.nuget.org/packages/Microsoft.AspNet.WebApi.SelfHost/ Web APIサービスを持っていて、うまくいきます。その後、https://www.nuget.org/packages/Microsoft.AspNet.WebApi.OwinSelfHost/に移行しましたが、問題があります。私たちはサーバーにサービスを展開し、40〜60分後にエラーが発生し、サービスが応答しなくなり、停止できませんでした。その後、プロセスを停止してサービスを開始し、次の40〜60分で正常に動作します。私が理解したよう我々は、ファイル内のログを参照してください、しかしLOGENTRIESOWIN logentries System.IndexOutOfRangeException
ではないので、しないの応答アペンダのスレッドやquequeをLOGENTRIES<appender name="LeAppender" type="log4net.Appender.LogentriesAppender, LogentriesLog4net">
<Debug value="true" />
<HttpPut value="false" />
<Ssl value="false" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="|%level%| %m" />
</layout>
</appender>
<root>
<priority value="ALL" />
<appender-ref ref="ConsoleAppender" />
<appender-ref ref="LogFileAppender" />
<appender-ref ref="LeAppender" />
</root>
エラー:
XXXX-XX-XX XX-XX-XX,XXX [Logentries Log Appender] FATAL Topshelf.Runtime.Windows.WindowsServiceHost The service threw an unhandled exception System.IndexOutOfRangeException: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffsetBytes, Array dst, Int32 dstOffsetBytes, Int32 byteCount)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.SyncTextWriter.Write(Char[] buffer, Int32 index, Int32 count)
at Microsoft.Owin.Hosting.Tracing.DualWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.WriteLine(String value)
at System.Diagnostics.TextWriterTraceListener.WriteLine(String message)
at System.Diagnostics.TraceInternal.WriteLine(String message)
at LogentriesCore.Net.AsyncLogger.WriteDebugMessages(String message)
at LogentriesCore.Net.AsyncLogger.Run()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
私は、デバッグモードを有効にすると、Iより多くの情報を得ました。アペンダーやアプリケーションに問題はありますか?もっと情報を得るには?
log4net:ERROR [LogentriesAppender] ErrorCode: GenericFailure. Failed in DoAppend
LE: Write complete, flush
LE: Flush complete
LE: Await queue data
System.IndexOutOfRangeException: Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffsetBytes, Array dst, Int32 dstOffsetBytes, Int32 byteCount)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.SyncTextWriter.Write(Char[] buffer, Int32 index, Int32 count)
at Microsoft.Owin.Hosting.Tracing.DualWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.WriteLine(String value)
at System.Diagnostics.TextWriterTraceListener.WriteLine(String message)
at System.Diagnostics.TraceInternal.WriteLine(String message)
at LogentriesCore.Net.AsyncLogger.WriteDebugMessages(String message)
at LogentriesCore.Net.AsyncLogger.AddLine(String line)
at log4net.Appender.LogentriesAppender.Append(LoggingEvent loggingEvent)
at log4net.Appender.AppenderSkeleton.DoAppend(LoggingEvent loggingEvent)
'LOGENTRIESアペンダにDEBUG'、http://haacked.com/archive/2006/09/27/Log4Net_Troubleshooting.aspx/(あなたは[log4netの内部デバッグを有効にする]ことができますので、 )を探して、何が起こっているのかを確認してください。 – stuartd