0 votes

Hi,

We use Mail.dll to send emails, we need to collect the SMTP log for each email, this needs to grab the particular SMTP log for one email and show that log of that email.

Currently, we use Limilabs.Mail.Log.WriteLine from this link.

The Issue:
When we send multiple emails concurrently, the log from Limilabs.Mail.Log.WriteLine is corrupted, for example, the log from email A finally appears in the log for email B.

We'd like to know if it is possible to get the SMTP log for each email, i.e. a safe way to get the log for each email or be able to identify the log for which email.

by

1 Answer

0 votes

Log class is a global class that logs all Mail.dll operations.

Neither Log class nor Log.WriteLine is created on per-instance basis. It is a global logging sink. It's more for troubleshooting that anything else.

You may think about adding thread id when logging a message.

Unfortunately it is not possible to gather per-instance logs at this time.

by (301k points)
...