Visual Guard Class Library Documentation

VGLogEntry Constructor (Int32, String, String, TraceEventType, StringDictionary)

Creates a new instance of VGLogEntry

public VGLogEntry(
   Int32 eventId,
   String title,
   String message,
   TraceEventType severity,
   StringDictionary properties
);

Parameters

eventId
the event identifier (>= 0 and < 10000)
title
the title of the message
message
the message body to log
severity
Log entry severity as a Severity enumeration.
properties
Dictionary of key/value pairs that can be used as extended properties in the message.

Remarks

You can use predefined values in your message. The list of predefined values is:

Exceptions

Exception Type Condition
ArgumentOutOfRangeException eventId is less than zero or greater than 9999.

Example

[C#]
StringDictionary dictionary = new StringDictionary();
dictionary.Add("myparam", "text of my param");
VGLogEntry entry = new VGLogEntry("User Id:[userid]", "Application:[tab][applicationid][newline]My parameter:[tab][p:myparam][newline]Computer:[tab][machine]", TraceEventType.Information, dictionary);
VGLogger.Write(entry);
[Visual Basic]
Dim dictionary as StringDictionary = new StringDictionary()
dictionary.Add("myparam", "text of my param")
Dim entry as VGLogEntry
entry = new VGLogEntry("User Id:[userid]", "Application:[tab][applicationid][newline]My parameter:[tab][p:myparam][newline]Computer:[tab][machine]", TraceEventType.Information, dictionary)
VGLogger.Write(entry)

See Also

VGLogEntry Class | Novalys.VisualGuard.Security.Logging Namespace | VGLogEntry Constructor Overload List