event-log

How do I programmatically or regularly clear the Operational PrintService event log?

陌路散爱 提交于 2019-12-02 03:06:58
问题 We are trying to do some in-house print auditing for printers we have running on a Windows Server 2008 R2. After enabling the log via Event Viewer in: Applications and Services Logs -> Microsoft -> Windows -> PrintService -> Operational I'm successfully grabbing events with the ID 307 by tailoring the answer to this question to my needs and then storing those events in a database for use in other applications. // Build formatted query string string eventID = "307"; string logSource =

Read Event log file from path

一个人想着一个人 提交于 2019-12-02 02:43:09
My question is very similar to this one How do you open the event log programatically? Except i'm logging anything. I need to create db of Log Entries from multiple unconnected machines. I get .evtx files then i try to process them. Right now i'm doing it from exported xml files. But i would like to skip the to xml conversion part. I've read the https://msdn.microsoft.com/en-us/library/System.Diagnostics.EventLog.aspx article but i didn't find what i was looking for. Is there a way to do what i want without converting to xml? Use System.Diagnostics.Eventing.Reader.EventLogReader : using (var

How do I programmatically or regularly clear the Operational PrintService event log?

匆匆过客 提交于 2019-12-02 01:27:56
We are trying to do some in-house print auditing for printers we have running on a Windows Server 2008 R2. After enabling the log via Event Viewer in: Applications and Services Logs -> Microsoft -> Windows -> PrintService -> Operational I'm successfully grabbing events with the ID 307 by tailoring the answer to this question to my needs and then storing those events in a database for use in other applications. // Build formatted query string string eventID = "307"; string logSource = "Microsoft-Windows-PrintService/Operational"; string sQuery = String.Format("*[System/EventID={0}]", eventID);

IIS FTP 7.5 Extensibility (IFtpLogProvider and logging FTP failures to the event log)

时光怂恿深爱的人放手 提交于 2019-12-01 22:44:43
Anyone pretty familiar with FTP 7.5 extensibility in IIS know what I might be doing wrong? I am having serious trouble getting an implementation of IFtpLogProvider to work correctly for custom logging. All I want to do is log failures beyond a static threshold to the event log, and have garbage collection every so often. I've tried working with a generic dictionary and the provider with no luck, and now even this simple bit of code I can't get working. The provider is not even creating the event log in the code stub below (or using it if I create it beforehand). So now I am deeply confused. I

EventSource .net 4.0 GenerateManifest

♀尐吖头ヾ 提交于 2019-12-01 21:49:46
I've been trying to work with ETW in .net 4.0. I have started using Microsoft EventSource Library 1.0.4-beta ( https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.EventSource ) Here is the code i written for generating events for my application. [EventSource(Name = "Samples-EventSourceDemos-EventSourceLogger")] public sealed class EventSourceLogger : EventSource { public static EventSourceLogger Log = new EventSourceLogger(); public static string GetManifest() { return GenerateManifest(typeof(EventSourceLogger), null); } [Event(200, Level = Microsoft.Diagnostics.Tracing.EventLevel

Organizing eventlogs into folders

这一生的挚爱 提交于 2019-12-01 18:39:55
问题 I want to create multiple services and I want them to log each in a log entry under the same directory/folder that I specify so when I open Windows Event Viewer I can see them all placed in one folder. For example service1 would log into service1_log, service2 would log into service2_log and both service1_log and service2_log would reside in one folder named Myservices. I haven't found anything in Windows Event Log API or any other API that would fit into this problem..I can see in windows

log4net permission issue to write to application event log when the user is not in admin group in Windows 2008 R2 and IIS 7

邮差的信 提交于 2019-12-01 13:11:27
I am having log4net permission issue from ASP.Net 4.0 web application to write to application event log, when the user is not in administrator group in Windows 2008 R2 and IIS 7. We are using NT authentication and impersonation. Once I assign the user to admin group it works fine. I tried with many permission settings like giving Authenticated Users full permission to Eventlog in registry etc. and none of them work. If any one can help that will be great. When I had a similar issue with logging to eventlog from a .net 1.1 app on Windows 2003 server I did CustomSD entry as below link and it

Enterprise library not logging severity correctly

橙三吉。 提交于 2019-12-01 12:56:09
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, Micros...ExceptionHandling" priority="0" /> </exceptionHandlers> My event log listener template starts

Return code of scheduled task prefixed with 0x8007000 in list view, registered as 0 in the event log

血红的双手。 提交于 2019-12-01 12:54:00
I am currently trying to setup monitoring of windows scheduled tasks in Zabbix. It seemed easy enough to just monitor the Microsoft-Windows-TaskScheduler/Operational event log filtered by 201 events and regexing on the return code, but when I started simulating errors to test the monitoring, nothing happened. It turns out that all our windows 2012 servers always log "return code 0" in the event log, even though it actually, sort of, displays it correctly in the Task Scheduler list view. When I say "sort of", it's because the "Last Run Result" actually displays 0x80070001 if the exit code of

log4net permission issue to write to application event log when the user is not in admin group in Windows 2008 R2 and IIS 7

陌路散爱 提交于 2019-12-01 11:40:21
问题 I am having log4net permission issue from ASP.Net 4.0 web application to write to application event log, when the user is not in administrator group in Windows 2008 R2 and IIS 7. We are using NT authentication and impersonation. Once I assign the user to admin group it works fine. I tried with many permission settings like giving Authenticated Users full permission to Eventlog in registry etc. and none of them work. If any one can help that will be great. When I had a similar issue with