Knowledge base

Logging email diagnostic information

Purpose

In some cases you may need to verify how the system is interacting with your mail server. This article explains how you can set up the system to log detailed diagnostic information whenever the system sends emails. 

Explanation

The system can generate a log file that logs every command sent to your mail server along with your mail server's response.

Steps to take (Xcb 1.x)

  1. First decide whether you want to log information for the Xcb web application OR the notification system.
  2. Open the appropriate configuration file in Notepad:
    • For the Xcb web application: Program Files\Xtheta\Xcb\WebApp\Web.Config
    • For the notification system: Program Files\Xtheta\Xcb\ServiceRunner.exe.config
  3. Scroll to the bottom of the file, and look for the line that says:
    </configuration>
  4. Directly above that line, add the following text (you can substitute in your own log file name by following the **NOTE** below):

            <system.diagnostics>
                <sharedListeners>
                    <!-- NOTE: You can change the filenames here if you want the log to be somewhere else.  
                               Please don't make any other changes besides the filename.                 
                                                                                                            VVVV
                      -->
                    <add name="SMTPTRACE" type="System.Diagnostics.TextWriterTraceListener" initializeData="SMTP.LOG" />
                    <add name="NOTIFTRACE" type="System.Diagnostics.TextWriterTraceListener" initializeData="NOTIF.LOG" />
                </sharedListeners>
                <trace autoflush="true" />
                <sources>
                    <source name="Xcb.Notifications">
                        <listeners>
                            <add name="NOTIFTRACE"/>
                        </listeners>
                    </source>
                    <source name="System.Net">
                        <listeners>
                            <add name="SMTPTRACE"/>
                        </listeners>
                    </source>
                    <source name="System.Net.Sockets">
                        <listeners>
                            <add name="SMTPTRACE"/>
                        </listeners>
                    </source>
                </sources>
                <switches>
                    <add name="Xcb.Notifications" value="Verbose" />
                    <add name="System.Net" value="Verbose" />
                    <add name="System.Net.Sockets" value="Verbose" />
                </switches>
            </system.diagnostics>

  5. Save the file.   If you're logging information for the notification system, you'll need to restart the notification service to make the changes take effect.  You don't need to restart anything if you're logging for the web application.
  6. When you no longer need the logging turned on, please remove the section and restart notifications (if needed).
          

Additional information

Please note that this log file gets large very quickly, so you should only enable logging on a short term basis. 

Difficulty

  • Intermediate - Not too bad but grab a cup of coffee first!

Applies to

General information

  • Last updated: 4/3/2015

Any feedback is appreciated