PPJ Manual
HomeCurrent IssuesDownloads
  • Welcome
  • Releases
    • PPJ 2023
  • PPJ 2023
  • PPJ Web API
  • PPJ Desktop API
  • Wisej.NET Documentation
  • General
    • Framework
      • Features
        • SAL and SQL Functions
        • Constants and Variables
        • SalContext
        • Visual Toolchest
        • XSal2
        • Reporting Support
        • LINQ Support
        • SalCompileAndEvaluate
        • Unicode Support
        • Startup Arguments
        • App.config
      • Data Types
        • Automatic Casts
        • Dynamic Arrays
      • Controls
        • ToolBar
        • TabControl
        • TableWindow
        • QuickObject
        • Ribbon Bar
        • NavigationBar
      • SQL Support
        • Configuration
        • ADO.NET Drivers
        • Bind and Into Variables
        • DBP Parameters
        • SqlContext
      • Extensions
        • Table Window
        • Unicode Support
        • Bug Fixes
        • Object Oriented Types
        • Custom Parsers
        • Named Properties
        • Microsoft Charts
        • Tabbed MDI
        • Watermark
        • HTML Rendering
      • Skins and Themes
        • Skin Files
        • Theme Files
        • Configuration
        • Skin Editor
        • Theme Builder
      • Tracing
        • Trace Viewer
        • Default Listeners
        • Tracing the Application
      • Spell Checker
        • Dictionaries
    • Ported Application
      • Project Structure
        • Late Bind Calls
        • Visual Styles
        • Unqualified References
        • Message Actions
        • When SQLError
        • Classes
      • Global Items
      • Forms
      • COM/ActiveX
      • Multiple Inheritance
      • Configuration Tool
      • Issues & Workarounds
    • Ported Reports
      • General
      • Crystal Reports
        • Structure
        • Unsupported Features
      • List & Label
        • Report Conversion
        • Structure
        • Document
        • Input Items
        • Passing Data
        • Unsupported Features
      • Reporting Services
        • Features
      • Stimulsoft
        • Break Groups
        • Fields
        • Formulas
        • Cache Mode
Powered by GitBook
On this page

Was this helpful?

  1. General
  2. Framework
  3. Tracing

Tracing the Application

PreviousDefault ListenersNextSpell Checker

Last updated 2 years ago

Was this helpful?

Developers can add their own trace calls to the migrated code using the same switches we have added to the PPJ Framework.

One of the switches is dedicated to the application(Sys.TraceApplication), but developers can use all the other switches as well or add their own. To add tracing information to migrated code use the following API:

Sys.TraceError(Sys.TraceApplication, text, args);
Sys.TraceWarning(Sys.TraceApplication, text, args);
Sys.TraceInfo(Sys.TraceApplication, text, args);
Sys.TraceVerbose(Sys.TraceApplication, text, args);
Sys.TraceException(Sys.TraceApplication, exception, level);

When the level assigned to the switch is equal or higher than the level indicated in the trace call, the trace goes through and gets logged. For example, if you add the following code to your application:

Sys.TraceInfo(
    Sys.TraceApplication, 
    "Login failed. User {0} has been locked.", strUserID);

The trace will be logged only if the Application switch has been set to the level Info (3) or higher:

<system.diagnostics>
<switches>
<add name="Application" value="3" />
</switches>
...
</system.diagnostics>

See MSDN for more information on TraceSwitch and TraceLevel:

http://msdn.microsoft.com/en-us/library/system.diagnostics.traceswitch.aspx