RE: Writing messages generated during execution to a file.
HI all
After i changed to client mode, I was able to resolve the part of generating & writing to text file after my class is executed, i tested with a error scenario & could see a text file being generated with Hello World.
Only issue i am having now is that AifInfoLog is blank whereas it is suppose to capture all the messages generated during my code execution.
Does AifInfoLog not capture all messages during code execution , if yes then please suggest a fix & if no then please suggest what should i use in place of AifInfolog so as to write all messages generated during my code execution to a text file.
Thanks in advance.
Shared below is my revised code.
protected void writeMessages2File(FilePath _filepath)
{
//Read logs & store in txt
AifInfoLog lAifInfoLog = new AifInfoLog();
#file
TextIo txIoRead, txIoWrite;
container conAllMessages;
str sTempPath,sFileName = _filepath,sOneRecord;
sFileName = "Log.txt";
conAllMessages = lAifInfoLog.getInfoLogData();
sTempPath = _filepath ;
if (WINAPI::fileExists(sFileName))
{
WINAPI::deleteFile(sTempPath sFileName);
}
txIoWrite = new TextIo (@sTempPath sFileName, 'w');
txIoWrite.write ("HELLO WORLD");
txIoWrite.writeExp(conAllMessages);
txIoWrite = null;
}