log4net for azure storage and smtp

https://www.nuget.org/packages/log4net.Appender.Azure
https://github.com/stemarie/log4net.Azure

The SmtpAppenderSection in 
https://logging.apache.org/log4net/release/config-examples.html

First problem, I have to add this assembly binding redirection manually.
<dependentAssembly>
    <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.0.8.0" newVersion="2.0.8.0" />
</dependentAssembly>

Second, originally I could get the log or mail. After some studied about these two log appenders, I found they all inherited the BufferingAppenderSkeleton. Logs will be stored in buffer unless it's full.

Because I want to receive the mail as soon as possible, I add this section to SmtpAppender:
<BufferSize = 0 />

留言

這個網誌中的熱門文章

修改Skype存放對話記錄、檔案的資料夾位置

[C# .Net] 因應資料庫Byte長度,修改中英混雜的字串長度

[C# .Net] 是否需要用 BufferedStream 當做 FileStream 的緩衝?