ImageGear .NET
Error Logging Configuration Settings

The PageView and ThumbnailView server-side controls have the ability to trace errors. In order for the server-side code for these controls to trace errors or just log information, web.config requires certain specific configuration settings.

Error logging configuration is optional. If this section is absent, then server-side error logging will not occur.

Below is a relevant snapshot of the web.config file.

Error logging will also not occur, even with these configuration settings, if your application is deployed in IIS and the IIS user (NetworkService) does not have write access to the folder where the log file is being output.

C#
Copy Code
<system.diagnostics>
      <!--Notes!!!-->
      <!--The following sections can permit the Accusoft Corporation ASP.NET component to record/log Errors and other information.-->
      <!--The imageGearSwitch values may have one of the following values: Off, Critical, Error, Warning, Information or Verbose.-->
      <!--Obviously, each successive value reults in more messages being generated.-->
    <switches>
      <add name="imageGearSwitch" value="Error" />
    </switches>
    <sources>
      <source name="ImageGear.Web" switchName="imageGearSwitch">
        <listeners>
          <add name="imageGearListener" traceOutputOptions="DateTime" type="System.Diagnostics.TextWriterTraceListener" initializeData="ImageGear.Web.log" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

These settings are shared both by PageView and ThumbnailView controls.

All the element pairs and attributes above are standard Web.Config elements and attributes and many different arrangements can be deployed. The above sample illustrates the minimum arrangement for logging events.

The name attributes demonstrated above are suggested name strings and all could be changed, save one. The source name = "ImageGear.Web" must be used or error logging from the ImageGear.Web server-side code will not function correctly. Everything else may have a custom name. Of course, names must be consistent, like between the switchName and the name attribute between the switches elements.

The switches element pair has one necessary attribute that adds the switch name to be used and what level of logging is desired. It is recommended that you use the control's Action List item "Default Error Logging Configuration" for initial configuration. However, you may want to replace the value error on your production server with one of the values stated in the commented out section (Off, Critical, Error, Warning, Information or Verbose). Going in the above order, Off will give no logging to Verbose giving the most logging from the Asp.Net server product. Most of the logging information is primarily intended to aid the Accusoft Corporation support team, if a problem should arise (the email address for support is support@accusoft.com).  

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback