Hello,
It is on Windows platform, and you know the file path, right? If so, please refer to the following code:
#if WINDOWS
var stream = await FileSystem.OpenAppPackageFileAsync("a.log");// your log file in Raw folder
XmlDocument XNLDOC = new XmlDocument();
XNLDOC.Load(stream);
XmlNodeList list = XNLDOC.SelectNodes("configuration");
XmlNode configuration = list[0];
XmlNodeList listLog4List = configuration.SelectNodes("log4net");
XmlNode appender = listLog4List[0];
XmlNode fileNodes = appender.ChildNodes[1];
XmlNodeList appenderList= fileNodes.SelectNodes("file");
XmlNode itemNode = appenderList[1];
string fileValue = itemNode.Attributes["value"].Value;
Debug.WriteLine(fileValue);
//foreach (XmlNode item in appenderList)
//{
// string value = item.OuterXml;
// string nodeValue = item.Attributes["value"].Value;
// Debug.WriteLine("{0},--{1}", value,nodeValue);
//}
#endif
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.