質問です。
ETW(Event Tracing for Windows)のlogをtextfileに落としたいです。
Windows7, Visual Studio 2015 communityの組み合わせでconsole applicationを作っています。
http://blog.okazuki.jp/entries/2014/07/13
を参考にNuGetして、次のコードを書きました。
これでconsoleには出せるのですが、それをfileにする方法がわかりません。
アドバイスお願いします。
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging;
using Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Formatters;
using System.Diagnostics.Tracing;
// リスナーを作る
var listener = new ObservableEventListener();
// 監視するログの種類を設定
listener.EnableEvents(
MyEventSource.Log,
EventLevel.Verbose,
MyEventSource.Keywords.Diagnostic | MyEventSource.Keywords.Lifecycle);
// ログを出力する
//listener.LogToConsole(new JsonEventTextFormatter()); //JSON形式
listener.LogToConsole();
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2016/02/12 00:22
2016/02/12 02:09
退会済みユーザー
2016/02/12 07:14
2016/02/12 08:53
退会済みユーザー
2016/02/15 06:00