Email Error Logger
The email error logger sends emails when a FATAL error is logged in the KODIAK Oms Order Entry Server. To enable the Email error logger you must uncomment all the lines in the log4net.config in the C:\KodiakOrderEntryServer\Config\ directory.
For example:
<logger name="Genium.DropCopy.Events" additivity="false">
<level value="TRACE"/>
<appender-ref ref="Genium.DropCopy.Events.Appender"/>
<!--<appender-ref ref="EmailErrorLog" />-->
</logger>
Should be and this should be done in all occurrences of the commented EmailErrorLog
<logger name="Genium.DropCopy.Events" additivity="false">
<level value="TRACE"/>
<appender-ref ref="Genium.DropCopy.Events.Appender"/>
<appender-ref ref="EmailErrorLog" />
</logger>
Here is an example of the EmailErrorLog appender:
<!-- Email Error Logger configurations can be changed here-->
<appender name="EmailErrorLog" type="log4net.Appender.SmtpAppender">
<!-- Email address to send error log to, multiple addresses can be configured by adding "," between email addresses -->
<to value="XXXX" />
<!-- Email address to send error log from-->
<from value="XXXX" />
<!-- Email subject, must remove TEST when run in production -->
<subject value="Kodiak OMS Order Entry Server Error" />
<!-- Email SMTP server address -->
<smtphost value="XXXX" />
<!-- TCP port used for the SMTP connection. Port 587 is the modern STARTTLS submission port; Office 365 accepts 25 or 587. If omitted, .NET’s SmtpClient uses 25.-->
<port value="25"/>
<!-- Number of log events queued before an email is sent. Setting it small (or 1) sends a message almost immediately; larger buffers reduce email volume at the cost of delayed alerts.
0 (or omitting the tag) means “send every event immediately.”-->
<bufferSize value="1"/>
<!-- Tells SmtpAppender to log in to the SMTP server. Acceptable values: None, Basic, Ntlm. If omitted, the default is None.-->
<authentication value="None"/>
<!-- If using Basic or Ntlm you must provide usernamr and password
<authentication value="Basic" />
<username value="XXXX" />
<password value="XXXX"/> -->
<!-- If authentication is Basic or Ntlm EnableSsl must be set to true for Office 365/Exchange Online.-->
<EnableSsl value="false" />
<lossy value="false"/>
<threshold value="FATAL"/>
<layout type="log4net.Layout.PatternLayout,log4net">
<conversionpattern value="%property{log4net:HostName} :: %level :: %message %newlineLogger: %logger%newlineDate: %date%newline" />
</layout>
</appender>
XML element / attribute | What it means | Typical defaults / tips |
---|---|---|
| Declares an appender named EmailErrorLog that uses the built-in | Name is arbitrary; type must be the fully-qualified class name. |
| Comma-separated list of recipients who will receive the email. | Supports plain addresses or “Display Name <address>”. |
| Sender address that appears in the From header. Must be valid for the SMTP server so that SPF/DMARC checks pass. |
|
| Subject line of each email. You can include | Often appended with the process name or environment (e.g. “- DEV”). |
| Hostname of your SMTP relay. If you omit it, |
|
| Tells | If omitted, the default is |
| Credentials used when | Consider pulling these from the machine-level |
| When | Defaults to |
| TCP port used for the SMTP connection. Port 587 is the modern STARTTLS submission port; Office 365 accepts 25 or 587. | If omitted, |
| Number of log events queued before an email is sent. Setting it small (or |
|
| If | Keep |
| Governs how each log event is rendered into text that becomes the email body. | Other layout choices: |
| Template used by the | Remember |