1

我正在执行以下操作以使用 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);                     
        }

这些日志会话保存为二进制 .etl 文件。有没有办法将它们保存为文本或以任何方式转换它们?

提前致谢!

4

1 回答 1

1

此命令可以将 ETL 文件转换为 XML:

tracerpt.exe LogFile.etl -of XML -o LogFile.xml

你可以在这里找到一个完整的例子:

https://msdn.microsoft.com/en-us/library/windows/apps/windows.foundation.diagnostics.fileloggingsession

于 2015-10-21T19:24:15.910 回答