Audit Trail Generator Sample
This sample demonstrates how to generate the CME audit trail files for iLink3 log files.
It has the following argument:
LogFileToAnalyse
- The path to the summary log file that will be used as a source file for audit trail data or the folder that contains such files.
NOTE: Please do not forget to place the SBE Schema template file in the folder where this sampple is located.
Usage example:
dotnet OnixS.Cme.ILink3.AuditTrailGenerator.dll LogFileToAnalyse.summary
NOTE: The format of the summary log file and audit trail requirements for CME iLink 3 differs from the CME iLink 2. Therefore, this tool can generate audit trail files only for the logs created for iLink 3.
Source code
using OnixS.Cme.ILink3;
using System;
namespace AuditTrailGeneratorSample
{
public class AuditTrailGeneratorSample
{
private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
public static int Main(string[] args)
{
try
{
if (args.Length < 1)
{
Console.WriteLine("Usage: LogFileToAnalyse.summary or LogFolderPath");
return 1;
}
string path = args[0];
AuditTrailGenerator generator = new ("ilinkbinary.xml", "../../../../../license|../../../../license|.");
generator.Generate(path);
}
catch (Exception ex)
{
logger.Error("Exception: " + ex.ToString());
return 2;
}
finally
{
NLog.LogManager.Shutdown();
}
return 0;
}
}
}