Search

Atalasoft Knowledge Base

HOWTO: Add Verbose Logging to WebDocumentViewer

Tananda
DotImage

When encountering errors saving and other errors where you get a vague/minimal error in the error message on the network trace, the handler may return an error message that says {System.Web.Exception} without much useful detail

In order to 'dial up' logging, it is necessary to add some diagnostic listeners to your web.config

In this example we're going go assume your login username is YOUR_USERNAME. Obviously, here you will change this to your actual username

Alternately, if you want to set the folder to something more generic, just make sure NOT to use a protected directory such as c:\Temp etc.

  • Open your web project in Visual studio
  • Find the web.config file
  • In that file, inside the cloture, paste this in:
      <!-- The Following section can be enabled to add verbose logging for debugging issues with Handlers -->
      <!-- It is suggested to only use this when actively troubleshooting and disabling for production-->
      <!-- For the log filepath in initalizeData set to a directory you have full control over -->
      <!-- SUGGGESTED your user profile directory - make sure to change "YOUR_USERNAME" -->
      <system.diagnostics>
        <trace autoflush="true"/>
    
        <switches>
          <add name="TraceLevelSwitch" value="Verbose"/>
        </switches>
    
        <sharedListeners>
          <add name="WebControls" initializeData="c:\users\YOUR_USERNAME\AppData\Local\Atalasoft\webcontrols.log" type="System.Diagnostics.TextWriterTraceListener"/>
        </sharedListeners>
    
        <sources>
          <source name="Atalasoft.dotImage.WebControls" switchName="TraceLevelSwitch">
            <listeners>
              <clear/>
              <add name="WebControls"/>
            </listeners>
          </source>
        </sources>
      </system.diagnostics>
    

Save this out then rebuild and refresh your browser to start logging. You can attach the log to a support case as a text file attachment (PLEASE DO NOT paste long logs or blocks of code into cases directly - please attach as a file attachment)

Details
Last Modified: Yesterday @ 6:51 AM
Last Modified By: Tananda
Type: HOWTO
Rated 3 stars based on 2 votes.
Article has been viewed 1.1K times.
Options
Also In This Category