我正在使用LogginSession来保存LogFiles并将其写入文件:
loggingChannel = new Windows.Foundation.Diagnostics.LoggingChannel("FlSMobileLogger");
LoggingSession = new Windows.Foundation.Diagnostics.LoggingSession("FLSMobileLog");
LoggingSession.addLoggingChannel(loggingChannel);
....
function enteredWhenLogEventOccurs(message) {
var dateString = new Date().toJSON();
var currentDate = dateString.substring(0, 4) + "-" + dateString.substring(5, 7) + "-" + dateString.substring(8, 10);
var fileName = "log" + currentDate + ".log";
loggingChannel.logMessage(message);
LoggingSession.saveToFileAsync(WinJS.Application.local.folder, fileName);
}
这些logsession保存为二进制.etl文件。 有没有办法将它们保存为文本或以任何方式转换它们?
提前致谢!
答案 0 :(得分:1)
此命令可以将ETL文件转换为XML:
tracerpt.exe LogFile.etl -of XML -o LogFile.xml
您可以在此处找到完整的示例: