Click or drag to resize

How to use Visual Guard Logging features

The Novalys.VisualGuard.Security.Logging namespace provides classes used to write in the log of a Visual Guard repository.

The Novalys.VisualGuard.Security.LoggingVGLogger class allows to write a log entry in a repository log.

The Novalys.VisualGuard.Security.LoggingVGLogEntry represents a message to write in a repository log.

For Visual Guard repository using database as backing store, all messages are stored in the table 'vg_Log' and contains the following information:

  • EventId - The unique identifier of log entry.
  • ApplicationId - The unique identifier of the application for which the log entry was generated.
  • UserId - The repository id of the current user.
  • TimeStamp - Date and time of the log entry message.
  • MachineName - The Name of the computer.
  • Title - The title of the log entry message.
  • Message - The body of the log entry message.
  • Severity - Log entry severity as a TraceEventType enumeration

For Visual Guard repository based on files, all messages are stored in the 'vg_Log.log' file located in the folder of your repository.

You can use the method WriteLog to write a message in the log of the repository.

You can use the property VGSecurityRuntimeLogEnabled to test whether the log is enabled for the repository.

By default the log is enabled for all repositories. If you want to disable the log for a repository, you must use the Visual Guard console and set the property 'Log enabled' to false for your repository.

You can consult the content of the log or generate a report by using the Visual Guard console. Connect you to the repository, select the repository item in th treeview to consult the log for all applications or an application item to consult the log activites of a specific application. After selecting the right item, right-click then select the option 'Event Viewer...'. This option is available only for 'Master Administrator'

Visual Guard does not automatically clean up or archive log events. It is possible to clean up events of a repository or an application from the Event Viewer' dialog box of the Visual Guard console or add a custom database trigger to the 'vg_Log' table when you want to automatically delete or archive events.