event-log

Enterprise library not logging severity correctly

时光毁灭记忆、已成空白 提交于 2019-12-01 11:24:31
问题 I have a problem with enterprise library 5. It's writing to the event log all the information I want it to write, however, it is not respecting the severity settings I configure. My exception handling configuration block looks like this: <exceptionHandlers> <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging...," logCategory="General" eventId="10000" severity="Critical" title="My unknown error" formatterType="Micros...ExceptionFormatter,

Using EventLog in ClickOnce application

☆樱花仙子☆ 提交于 2019-12-01 05:48:52
I've got a library that I use across multiple ClickOnce applications. In the event of an error in this library I would like to write the error to the windows EventLog . I found a KB article on how but it seems that this requires administrator permissions to search the for the source. Specifically it chokes when trying to search the Security event log. Is there anyway to work around this and write to the event log in a ClickOnce application? I saw one person trying to write to a known source , but they didn't seem to be able to find a source that was consistently available. EDIT: Based on

Using EventLog in ClickOnce application

心不动则不痛 提交于 2019-12-01 02:22:18
问题 I've got a library that I use across multiple ClickOnce applications. In the event of an error in this library I would like to write the error to the windows EventLog . I found a KB article on how but it seems that this requires administrator permissions to search the for the source. Specifically it chokes when trying to search the Security event log. Is there anyway to work around this and write to the event log in a ClickOnce application? I saw one person trying to write to a known source,

log4net doesn't log in Windows Event Viewer

夙愿已清 提交于 2019-11-30 21:23:11
I would like to log in the Windows Event Viewer using log4net. I created a Console Application (.NET Framework 4), I added the reference log4net.dll, I put the following code in my App.config: <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> </configSections> <log4net> <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender"> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"/> </layout> </appender> <root> <level

Eventlog listener - Applications and Services

♀尐吖头ヾ 提交于 2019-11-30 20:57:13
Is there a way to watch events of "applications and services" when they are generated (in C#)? I've figured out that I can not use WMI for it. Any other ideas? You can subscribe to EventLog.EntryWritten Event Occurs when an entry is written to an event log on the local computer. From MSDN: .... EventLog myNewLog = new EventLog(); myNewLog.Log = "MyCustomLog"; myNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten); myNewLog.EnableRaisingEvents = true; } public static void MyOnEntryWritten(object source, EntryWrittenEventArgs e){ } Did your try it wit the EventLog.EntryWritten

Any light for TEventLogger?

∥☆過路亽.° 提交于 2019-11-30 14:42:51
I want to see about logging events from a Delphi 5 application to the Windows log, and from another post here I see that I can use the TEventLogger class to do this. However, I can't find any documentation on the syntax of the TEventLogger.LogMessage procedure, so I don't know what all the parameters mean, how to use them, or even what possible values are available. I've tried looking around, and all I find is a page from Embarcadero stating that the function exists, but nothing on its syntax, and MSDN is no help as I can only find the BizTalk version which does me no good. Does anyone have a

Retrofitting Windows Event Log to a Delphi 5 app

不羁的心 提交于 2019-11-30 14:20:20
问题 I'm looking for a (fairly pain-free) means of adding some Windows Application Event-Log support to a small legacy Delphi 5 application. We just want it to log when it starts-up, shuts-down, fails to connect to a database etc. Several of the solutions/components I've seen seem to suggest that we'll need to make a resource DLL which the Windows Event Log Viewer will link to when trying to read our 'entries'. While this doesn't seem too onerous, I guess it's something else to keep in mind if

EventLogQuery reader for remote computer?

这一生的挚爱 提交于 2019-11-30 13:40:45
I'm using this code to readmy own event Log from my win7 Computer. EventLogQuery eventsQuery = new EventLogQuery("Security", PathType.LogName, queryString); eventsQuery.ReverseDirection = true; EventLogReader logReader = new EventLogReader(eventsQuery); However - I need to read the EventLog for a remote computer ( Lan - Same domain) How can I do that ? http://msdn.microsoft.com/en-us/library/bb671200(v=vs.90).aspx public void QueryRemoteComputer() { string queryString = "*[System/Level=2]"; // XPATH Query SecureString pw = GetPassword(); EventLogSession session = new EventLogSession(

Why does EventRecord.FormatDescription() return null?

青春壹個敷衍的年華 提交于 2019-11-30 13:29:48
When using System.Diagnostics.Eventing.Reader.EventLogQuery to read events from the Windows Event Log, the EventRecord.FormatDescription() method sometimes returns null. Why is this? In the Event Viewer there are messages on the events which return null. This is due to a bug in the .NET framework. Basically what you need to do to work around this bug is to set the CurrentCulture to "en-US". Example: var beforeCulture = Thread.CurrentThread.CurrentCulture; try { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); using (var session = new EventLogSession(ipOrAddress, userDomain,

In Windows, what default event sources are available in the Application Event Log?

可紊 提交于 2019-11-30 12:34:53
Short Version: Are the event sources "Application" and "Application Error" always included in the Application Event Log? Are they available on new installations of Windows XP, Vista and Windows 7? Would it be really bad to use them instead of creating my own source (an impossibility for me)? Long Version: I have a ClickOnce application that is used by users without administrative privileges on their machines. When I try to write to the Appliction Event Log, I get a security exception. (The Windows event logging infrastructure is trying to create me a new event source, and gets a security