event-log

Getting IIS application pool recycle events to be logged in the Windows Event Log

北战南征 提交于 2019-12-21 12:18:26
问题 I am trying to get IIS 7 application pool recycle, start, stop, etc. events to be logged to the Windows Event Log . I followed the steps outlined in this article but didn't have any success. I restarted the application pool and nothing was logged in the Event Log. (I checked both the "Application" and "System" logs.) But when I do an IIS reset that gets logged. 回答1: For IIS 7 , IIS Manager can be used to enable recycle events to be logged in the Windows Event Log: Open IIS Manager. Click

Logparser error when used with PowerShell

非 Y 不嫁゛ 提交于 2019-12-20 07:27:23
问题 I'm trying to use Log Parser within PowerShell to export a Windows Evtx log file to CSV: $logparser = "c:\program files (x86)\Log Parser 2.2\logparser.exe" $allArgs = ("SELECT * INTO c:\logs\logs.csv FROM c:\logs\logs.evtx", "-i:evt", "-o:csv") $ps = Start-Process -FilePath $logparser -ArguementList $allArgs -Wait -Passthru -NoNewWindow; $ps.WaitForExit() $ps.ExitCode; But when I run this I get an error: Error: detected extra argument "*" after query The error code is 13. I tried putting the

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

南笙酒味 提交于 2019-12-20 03:40:31
问题 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

How do I write to a custom Windows event log?

对着背影说爱祢 提交于 2019-12-20 02:43:21
问题 I'm attempting to set up basic logging to the windows event log in .net via System.Diagnostics.EventLog, but I'm failing to see any events actually getting written to the log. Consider the following code: // Elsewhere in the class private static readonly string EventLogName = "LogName"; private static readonly string EventLogSource = "AppName"; // In the only function that does something if (!EventLog.Exists(EventLogName)) { EventLog.CreateEventSource(EventLogSource, EventLogName); return; }

EventSource .net 4.0 GenerateManifest

醉酒当歌 提交于 2019-12-20 01:49:10
问题 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

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

匆匆过客 提交于 2019-12-19 10:49:29
问题 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

How do you open the event log programatically?

柔情痞子 提交于 2019-12-19 04:35:26
问题 I'm logging errors to the event log using the usual: System.Diagnostics.Trace.TraceError("<" + purpose + "><time>" + DateTime.Now.ToUniversalTime() + "</time><message>" + message + "</message></" + purpose + ">"); and am wondering if there is a way to call this log file and display it for the user (either in my own format or by opening the event log file directly as does 'Event Viewer'). I've found the file in %SystemRoot%\System32\Winevt\Logs\mylog.evtx but not sure whether I should be

Any light for TEventLogger?

梦想与她 提交于 2019-12-18 17:01: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

EventLogQuery reader for remote computer?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 15:53:41
问题 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 ? 回答1: http://msdn.microsoft.com/en-us/library/bb671200(v=vs.90).aspx public void QueryRemoteComputer() { string queryString = "*[System/Level=2

Using XPath starts-with or contains functions to search Windows event logs

瘦欲@ 提交于 2019-12-18 14:00:14
问题 By editing the XML filter query manually in Windows event viewer, I can find events where the data matches a string exactly: <QueryList> <Query Id="0" Path="Application"> <Select Path="Application">*[EventData[Data and (Data="Session end: imzcjflrrsq1sfdk3okc4jpf")]]</Select> </Query> </QueryList> Now, I want to do a partial match: <QueryList> <Query Id="0" Path="Application"> <Select Path="Application">*[EventData[Data and (Data[starts-with(.,"Session")])]]</Select> </Query> </QueryList>