I am using NLog with a VB.Net project:
Private m_logger As NLog.Logger = LogManager.GetCurrentClassLogger()
Issues are populated in the log like this:
Catch ex As Exception
Console.WriteLine("Error: {0}", ex.Message.ToString())
m_logger.Error(ex, "ExtractCalendarInformation")
End Try
Now, this VB too is a console app that is used my another application which is written with Visual C++. If the parent app has detected that there are problems it displays the log file:
void CMeetingScheduleAssistantApp::ShowLogFile(CString strLogFile)
{
if (PathFileExists(strLogFile))
{
CLogDlg dlgLog;
CTextFileRead fileLog(strLogFile);
CString strText = _T("");
fileLog.ReadLine(strText);
while (!fileLog.Eof())
{
strText.Trim();
if (strText.IsEmpty())
continue;
dlgLog.AddLogEntry(strText, true);
fileLog.ReadLine(strText);
}
dlgLog.SetErrorMode(true);
dlgLog.DoModal();
}
}
The problem is that the log file is in date ascebdung order and sometimes users send me screen shots and don't scroll.
Is there anyway to display this error log from Nlog in fdate desending order? And I don't think it is OK to just read the file in reverse.
I include both VB and C++ tags since I might have to make changes in either tool.
I saw this question Write records in descending order in NLog. The thing is my C# tool uses SimpleLogger
and that creates log folders in a folder and the log is named by date, and all items in that log are date descending. But I can't use SimpleLogger
with VB.Net I don't think.