-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using log4net.Appender; | ||
|
||
namespace YaR.Clouds | ||
{ | ||
public class SmtpAsyncAppender : SmtpAppender | ||
{ | ||
protected override void SendEmail(string messageBody) | ||
{ | ||
Task.Run(() => | ||
{ | ||
try | ||
{ | ||
base.SendEmail(messageBody); | ||
} | ||
catch (Exception e) | ||
{ | ||
Console.WriteLine(e); | ||
throw; | ||
} | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ | |
<Copyright>[email protected]</Copyright> | ||
<Description>WebDAV emulator for Cloud.mail.ru</Description> | ||
<PackageId>WebDAVCloudMailRu</PackageId> | ||
<AssemblyVersion>1.13.1.2</AssemblyVersion> | ||
<FileVersion>1.13.1.2</FileVersion> | ||
<AssemblyVersion>1.13.2.0</AssemblyVersion> | ||
<FileVersion>1.13.2.0</FileVersion> | ||
<Version>$(AssemblyVersion)</Version> | ||
<AssemblyName>wdmrc</AssemblyName> | ||
<RootNamespace>YaR.Clouds.Console</RootNamespace> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,10 +40,32 @@ | |
</layout> | ||
</appender> | ||
|
||
<appender name="SmtpAsyncAppender" type="YaR.Clouds.SmtpAsyncAppender"> | ||
<to value="[email protected]" /> | ||
<from value="[email protected]" /> | ||
<subject value="WDMRC error" /> | ||
<smtpHost value="smtp.yandex.ru" /> | ||
<authentication value="Basic" /> | ||
<port value="587" /> | ||
<username value="[email protected]" /> | ||
<password value="my_application_password" /> | ||
<bufferSize value="1" /> | ||
<EnableSsl value="true"/> | ||
<lossy value="true" /> | ||
<threshold value="ERROR" /> | ||
<evaluator type="log4net.Core.LevelEvaluator"> | ||
<threshold value="WARN"/> | ||
</evaluator> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<conversionPattern value="%date{dd/MM/yyyy hh:mm:ss.fff}	%-5level	%-15logger	%message%newline" /> | ||
</layout> | ||
</appender> | ||
|
||
<root> | ||
<level value="ALL"/> | ||
<appender-ref ref="ColoredConsoleAppender"/> | ||
<!-- <appender-ref ref="RollingLogFileAppender"/> --> | ||
<!-- <appender-ref ref="SmtpAsyncAppender"/> --> | ||
</root> | ||
</log4net> | ||
|
||
|