This project is read-only.


SMTP Impostor uses System.Diagnostics.Trace for logging activity
to enable logging you need to add a listener to the config file

    <trace autoflush="true">
              name="File" type="System.Diagnostics.TextWriterTraceListener" 
              initializeData="C:\temp\Impostor.Log" /> 

make sure the application has write access to the log file

for the standard client installed by ClickOnce you have to find the install dir, this can be done by;
  1. run the Impostor client
  2. open Windows Task Manager
  3. find the process Antix.Mail.Smtp.Impostor.Client.exe and click properties
  4. the location is shown on the General tab

If you are referencing SMTP impostor you can also change how logging is done, the static class Log has a number of "Action" properties which you can set to a lambda to call Log4Net or what ever you like.

        public void LogExceptionOverridenAction() {
            var log = new StringBuilder();

            Log.LogErrorAction = (f, a) => {
                                     log.AppendLine(string.Format(f, a));

            try {
                throw new Exception(EXCEPTION_TEXT);
            catch (Exception ex) {
                Log.Error("LogException {0}", ex);

            Assert.IsTrue(log.Length > 0);

Last edited May 6, 2011 at 5:29 PM by Antix, version 1


No comments yet.