Enabling Logging in SMath Studio
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>\...)
Steps
1. Close all SMath Studio instances
Make sure every SMath Studio process is closed before editing the configuration file.
2. Open Solver.exe.config for editing
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 <!-- ... --> 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 file
Save the modified Solver.exe.config file and close the text editor.
5. Reproduce the issue
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): Template:Nowrap
- To open it quickly, press Win+R, type
%APPDATA%\SMath\, and press Enter.
The log file is Solver.log.
7. Examine the log
- Open
Solver.login a text editor. - 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.
8. Disable logging (recommended when finished)
After the issue is resolved or the log has been shared:
- Close SMath Studio.
- Re-comment the two XML blocks in
Solver.exe.config(restore the original state shown in Step 3). - Save the file.
- Optionally delete
%APPDATA%\SMath\Solver.logto clean up.
- Why disable logging? Leaving logging active causes the
Solver.logfile 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.