How to activate Tracing and Logging?

Estimated reading: 2 minutes 332 views

Tracing refers to the systematic recording of events, operations, and processes within the VG system. This functionality is crucial for debugging, monitoring system performance, auditing security processes, and ensuring compliance with regulatory standards. Tracing in VG captures detailed information about the system’s behavior, including authentication attempts, authorization checks, and other security-related events.

Purpose of Tracing in Identity Server

  1. Debugging and Troubleshooting: Helps identify and resolve issues within VG by providing a detailed log of events leading up to an error or malfunction.
  2. Security Auditing: Records security-related events, such as login attempts, access control decisions, and changes to security policies, which is essential for detecting potential breaches and unauthorized access attempts.
  3. Performance Monitoring: Tracks the performance of VG operations, allowing administrators to identify and address bottlenecks or inefficiencies in the system.
  4. Compliance and Reporting: Supports compliance with legal and regulatory requirements by logging access and changes to sensitive data, demonstrating that appropriate security controls are in place.

To enable different levels of tracing, choose the appropriate options in the appsettings.json file (visual reference provided below).


VGIdentityServerConfiguration.TraceLevel

This property specifies the minimum level to log for Visual Guard Identity Server activities.
It has following options available.

  • Off = 0, //Output no tracing and debugging messages.
  • Error = 1, //Output error-handling messages.
  • Warning = 2, //Output warnings and error-handling messages.
  • Info = 3, //Output informational messages, warnings, and error-handling messages.
  • Verbose = 4 //Output all debugging and tracing messages.

Logging

The Logging property can have LogLevel and log provider properties. The LogLevel specifies the minimum level to log for selected categories. In the screenshot, Information and Warning log levels are specified. LogLevel indicates the severity of the log and ranges from 0 to 6:

  • Trace = 0
  • Debug = 1
  • Information = 2
  • Warning = 3
  • Error = 4
  • Critical = 5
  • None = 6.

The “Default” and “Microsoft” categories are specified.
The “Microsoft” category applies to all categories that start with “Microsoft”.
The “Microsoft” category logs at log level Warning and higher.

A specific log provider is not specified, so LogLevel applies to all the enabled logging providers except for the Windows EventLog.


Check Logs and Traces

You can check the logs and traces files as shown below.