Click or drag to resize

VGLogEntry Constructor (Int32, String, String)

Creates a new instance of VGLogEntry

Namespace:  Novalys.VisualGuard.Security.Logging
Assembly:  Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2019.1.831.19 (2019.1.0831.19)
Syntax
public VGLogEntry(
	int eventId,
	string title,
	string message
)

Parameters

eventId
Type: SystemInt32
the event identifier (>= 0 and < 10000)
title
Type: SystemString
the title of the message
message
Type: SystemString
the message body to log
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptioneventId is less than zero or greater than 9999.
Remarks
You can use predefined values in your message. The list of predefined values is:
  • [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.
  • [machine] - The Name of the computer.
  • [severity] - Log entry severity as a TraceEventType enumeration
  • [tab] - Insert a tab character in the body of a message.
  • [newline] - Insert a newline character in the body of a message.
  • [p:XXX] - represents the property with the name 'XXX' stored in the specified dictionary.
Examples
StringDictionary dictionary = new StringDictionary();
dictionary.Add("myparam", "text of my param");
VGLogEntry entry = new VGLogEntry(1, "User Id:[userid]", "Application:[tab][applicationid][newline]My parameter:[tab][p:myparam][newline]Computer:[tab][machine]", TraceEventType.Information, dictionary);
VGLogger.Write(entry);
See Also