Skip to content

Enabling Logging in SMath Studio

When you experience a challenge or unexpected behavior in SMath Studio, enabling built-in logging helps diagnose the issue. The log file captures detailed trace information that you (or your software vendor) can use to identify the root cause.

Prerequisites

Locate where SMath Studio is installed:

  • Per-machine installation: C:\Program Files (x86)\SMath\ (or similar)
  • Per-user installation: your user profile folder (e.g., C:\Users\<YourName>...)

Enabling Logging

  1. Close all SMath Studio instances. Make sure every SMath Studio process is closed before editing the configuration file.
  2. Navigate to the SMath Studio installation folder and open the file Solver.exe.config with a text editor (e.g., Notepad). Note: administrator permissions may be required to modify this file if SMath Studio was installed per-machine. Right-click your text editor and choose Run as administrator.
  3. Uncomment the logging blocks. The file contains two blocks that are commented out by default. You need to remove the XML comment markers (<!-- and -->) so that the configuration becomes active.

    Below is the default (commented) content -- both the <source> elements and the <add> listener element are wrapped in comments:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <system.diagnostics>
        <sources>
          <!--
            The name attribute of <source> element is split by dot in order to build the hierarchy of sources for loggers.
            The source with name="root" defines the root in the hierarchy.
            Use attribute newSwitch="true" in order to redefine the switch for the related source and its descendants.
            Use attribute newListeners="true" in order to redefine the listeners for the related source and its descendants.
            Supported values of attribute switchValue in order of verbosity: "Off" (default), "Critical", "Error", "Warning", "Information", "Verbose"
          -->
          <!--
          <source name="root">
            <listeners>
              <add name="file" />
            </listeners>
          </source>
          <source name="SMath.Controls" newSwitch="true" switchValue="Error" />
          <source name="SMath.Environment" newSwitch="true" switchValue="Error" />
          <source name="SMath.Document" newSwitch="true" switchValue="Error" />
          <source name="SMath.Manager" newSwitch="true" switchValue="Error" />
          <source name="SMath.UI" newSwitch="true" switchValue="Error" />
          -->
        </sources>
        <sharedListeners>
          <!-- Writes trace to file -->
          <!--
          <add name="file"
               type="SMath.Manager.Logging.FileTraceListener, SMath.Manager"
               traceOutputOptions="DateTime,ProcessId,ThreadId"
               initializeData="%APPDATA%\SMath\Solver.log"/>
          -->
        </sharedListeners>
        <trace autoflush="true" indentsize="4" />
      </system.diagnostics>
    </configuration>
    

    Uncomment the two XML blocks that contain actual configuration (the <source> elements and the <add> listener element), while keeping the description comment (the first comment block that contains explanatory text). After uncommenting, the file should look like this:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <system.diagnostics>
        <sources>
          <!--
            The name attribute of <source> element is split by dot in order to build the hierarchy of sources for loggers.
            The source with name="root" defines the root in the hierarchy.
            Use attribute newSwitch="true" in order to redefine the switch for the related source and its descendants.
            Use attribute newListeners="true" in order to redefine the listeners for the related source and its descendants.
            Supported values of attribute switchValue in order of verbosity: "Off" (default), "Critical", "Error", "Warning", "Information", "Verbose"
          -->
          <source name="root">
            <listeners>
              <add name="file" />
            </listeners>
          </source>
          <source name="SMath.Controls" newSwitch="true" switchValue="Error" />
          <source name="SMath.Environment" newSwitch="true" switchValue="Error" />
          <source name="SMath.Document" newSwitch="true" switchValue="Error" />
          <source name="SMath.Manager" newSwitch="true" switchValue="Error" />
          <source name="SMath.UI" newSwitch="true" switchValue="Error" />
        </sources>
        <sharedListeners>
          <!-- Writes trace to file -->
          <add name="file"
               type="SMath.Manager.Logging.FileTraceListener, SMath.Manager"
               traceOutputOptions="DateTime,ProcessId,ThreadId"
               initializeData="%APPDATA%\SMath\Solver.log"/>
        </sharedListeners>
        <trace autoflush="true" indentsize="4" />
      </system.diagnostics>
    </configuration>
    

    Tip: only uncomment XML elements that contain nested XML structures (the <source> and <add> elements). Keep pure description text as comments.

  4. Save the modified Solver.exe.config file and close the text editor.

  5. Open SMath Studio and perform the steps that triggered the problem. The application will now write trace output to the log file.
  6. Retrieve the log file. Navigate to the log folder (no administrator access required): %APPDATA%\SMath\ (press Win+R, type it in, and press Enter to open it quickly). The log file is Solver.log.
  7. Examine the log. Open Solver.log in a text editor and scroll to the last lines -- the most recent entries are where the relevant challenge is typically recorded. Either identify the error/exception message yourself, or attach the log file (or its meaningful section) to a support request to your software vendor.

Disabling Logging

After the issue is resolved or the log has been shared, it is recommended to turn logging back off:

  1. Close SMath Studio.
  2. Re-comment the two XML blocks in Solver.exe.config (restore the original state shown above).
  3. Save the file.
  4. Optionally delete %APPDATA%\SMath\Solver.log to clean up.

Note: leaving logging active causes the Solver.log file to grow uncontrolled over time, consuming disk space and potentially slowing down file operations. Restoring the default (commented) state is a best practice once diagnostics are complete.