|
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Logger;
namespace LogClient
{
class Program
{
static void Main(string[] args)
{
TestLogger();
}
static void TestLogger()
{
CLogger TestLogger = new CLogger();
TestLogger.Initialize("C:", "Test.log"); // Specify location and log file name
//TestLogger.Initialize("C:", "Test.log", 50); // Set log file size as well
// Logging just message strings with different severity levels
TestLogger.LogInformation("My First Test Log Message");
TestLogger.LogWarning("My First Test Log Message");
TestLogger.LogError("My First Test Log Message");
// Logging error codes and message strings with different severity levels
TestLogger.LogInformation(1005, "My First Test Log Message");
TestLogger.LogWarning(1005, "My First Test Log Message");
TestLogger.LogError(1005, "My First Test Log Message");
// Logging class name, method name and message strings with different severity levels
TestLogger.LogInformation("LogClient", "TestLog", "My First Test Log Message");
TestLogger.LogWarning("LogClient", "TestLog", "My First Test Log Message");
TestLogger.LogError("LogClient", "TestLog", "My First Test Log Message");
TestLogger.Terminate();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.