开发者

EventLogAppender write only my app events

How to config EventLogAppender for write only events from my app. Because, currently I have next configuration:

    var elAppender = new EventLo开发者_JAVA百科gAppender
                         {
                             ApplicationName = "My App",
                             LogName = "My Log",
                             Layout = new PatternLayout(default_format),
                             Threshold = Level.Error
                         };
    elAppender.ActivateOptions();

and in My Log present all messages from the all applications like Application, bu I need events only from My App. Thank you.


You could create a filtered view within Event Viewer. This way, you don't need to change your application.


I found solution :),

I recreated my appender without spaces in the name and everything worked :) the code like this:

var elAppender = new EventLogAppender
                         {
                             ApplicationName = **"MyApp"**,
                             LogName = **"MyLog"**,
                             Layout = new PatternLayout(default_format),
                             Threshold = Level.Error
                         };
    elAppender.ActivateOptions();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜