Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/error email sd automation #10

Merged
merged 4 commits into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 32 additions & 33 deletions web/nlog.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,39 @@
<target xsi:type="File" name="smtpSentLog" fileName="${logDirectory}\Email\viperlog-${shortdate}.log"
header="Date Time|Level|Logger|Subject|To|Message"
layout="${longdate}|${uppercase:${level}}|${event-properties:item=CallingMethod}|${event-properties:item=Subject}|${event-properties:item=To}|${message}" />

<target xsi:type="Mail"
name="warningErrorEmail"
smtpServer="ucdavis-edu.mail.protection.outlook.com"
<target xsi:type="Mail"
name="warningErrorEmail"
smtpServer="ucdavis-edu.mail.protection.outlook.com"
smtpPort="25"
smtpAuthentication="None"
enableSsl="true"
html="true"
addNewLines="true"
replaceNewlineWithBrTagInHtml="true"
subject="@SDP@ VIPER Error: ${aspnet-Request-Url}: ${machinename} ${date}"
to="[email protected]"
from="[email protected]"
body="&lt;b&gt;User Info:&lt;/b&gt;${newline}
Severity: ${uppercase:${level}}${newline}
User Identity: ${aspnet-User-Identity} ${newline}
Client IP: ${aspnet-Request-IP}${newline}
Method: ${aspnet-Request-Method}${newline}
Url: ${aspnet-Request-Url}${newline}
QueryString: ${aspnet-Request-QueryString}${newline}
Referrer: ${aspnet-Request-Referrer}${newline}
UserAgent: ${aspnet-Request-UserAgent}${newline}${newline}
&lt;b&gt;Exception:&lt;/b&gt;${newline}
Message: ${message}${newline}
Source: ${logger}${newline}
Stack: ${exception:format=tostring,Data:maxInnerExceptionLevel=10}

@@SITE=SVM@@
@@CATEGORY=Web Apps@@
@@SUBCATEGORY=VIPER@@
@@STATUS=In Progress@@
@@GROUP=Administrative Applications@@
@@REQUESTER=VIPER AUTOSUBMIT@@
@@[email protected]@@"
/>
html="true"
addNewLines="true"
replaceNewlineWithBrTagInHtml="true"
subject="@SDP@ VIPER Error: ${aspnet-Request-Url}: ${machinename} ${date}"
to="[email protected]"
from="[email protected]"
body="&lt;b&gt;User Info:&lt;/b&gt;${newline}
Severity: ${uppercase:${level}}${newline}
User Identity: ${aspnet-User-Identity} ${newline}
Client IP: ${aspnet-Request-IP}${newline}
Method: ${aspnet-Request-Method}${newline}
Url: ${aspnet-Request-Url}${newline}
QueryString: ${aspnet-Request-QueryString}${newline}
Referrer: ${aspnet-Request-Referrer}${newline}
UserAgent: ${aspnet-Request-UserAgent}${newline}${newline}
&lt;b&gt;Exception:&lt;/b&gt;${newline}
Message: ${message}${newline}
Source: ${logger}${newline}
Stack: ${exception:format=tostring,Data:maxInnerExceptionLevel=10}
@@SITE=SVM@@
@@CATEGORY=Web Apps@@
@@SUBCATEGORY=VIPER@@
@@STATUS=In Progress@@
@@GROUP=Administrative Applications@@
@@REQUESTER=VIPER AUTOSUBMIT@@
@@[email protected]@@"
/>

<!--Console Target for hosting lifetime messages to improve Docker / Visual Studio startup detection -->
<target xsi:type="Console" name="lifetimeConsole" layout="${MicrosoftConsoleLayout}" />
Expand Down Expand Up @@ -103,7 +101,8 @@
<logger name="*" minlevel="Error" writeTo="warningErrorEmail">
<filters defaultAction='Log'>
<when condition="contains('${currentEnviroment}','Development')" action="Ignore" />
<when condition="contains('${currentEnviroment}','Test')" action="Ignore" />
<when condition="contains('${currentEnviroment}','Test')" action="Ignore" />
<whenRepeated layout="${aspnet-User-Identity}|${message}" timeoutSeconds="600" action="Ignore" />
</filters>
</logger>

Expand Down