All base SwEx modules inherit the IModule interface which provides an access to ILogger instance allowing to log custom messages and exception from the module.

The following modules provide logger:

Additional options can be specified by decorating the module class via LoggerOptionsAttribute

[LoggerOptions(true, LOGGER_NAME)]
public class AddIn : SwAddInEx
{
    internal const string LOGGER_NAME = "MyAddInLog";

    public override bool OnConnect()
    {
        try
        {
            Logger.Log("Connecting to database");
            ConnectToDatabase();
        }
        catch (Exception ex)
        {
            Logger.Log(ex);
            throw;
        }
    }
}

Specified logger name will be appended to the SwEx module name (e.g. SwEx.AddIn.MyAddInLog or SwEx.MacroFeature.MyAddInLog or SwEx.PMPage.MyAddInLog).

Log messages are output into the output as setup via LoggerOptionsAttribute attribute. Currently only debug trace logger is supported. Refer Troubleshooting article for the instructions of how to capture debug trace messages.