event-log

Windows service always writes to custom log and application log

穿精又带淫゛_ 提交于 2019-12-08 02:56:38
问题 I am using a custom EventLog for my Windows service. The service creates the event source after installtion. I don't have any problems. However, I have setup my service so that I can run it from the IDE using the following mechanism: static void Main(string[] args) { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledException); string firstArgument = string.Empty; if (args.Length > 0) firstArgument = args[0].ToUpperInvariant(); if (string.Compare

Application error: fault address 0x00012afb (Expert)

与世无争的帅哥 提交于 2019-12-08 01:52:53
问题 I need some "light" to get a solution. Probably there are tons of things that cause this problem, but maybe somebody could help me. Scenario: a Windows server running 24/7 a PostgreSQL database and others server applications (for processing tasks on database, etc...). There are differents servers scenarios (~30), with different hardware and windows versions (XP SP3/ WinServer, etc... all NT based). All aplications were written in Delphi7, and link to DLLs (in D7 also). After some days

Subscribe to Non System (Custom) Events in an Event Log

我怕爱的太早我们不能终老 提交于 2019-12-08 01:22:38
问题 I want to raise an event whenever a new log entry is added to a particular event log file in windows event viewer. I am trying to do something similar to what is mentioned here. http://msdn.microsoft.com/en-us/library/bb671202.aspx Here is my code: static void Main() { EventLogWatcher watcher = null; try { EventLogQuery eventQuery = new EventLogQuery("C:\\Windows\\System32\\winevt\\Logs\\Admin.evtx", PathType.FilePath); EventLogReader logReader = new EventLogReader(eventQuery);

EventLog permission failing in ASP.Net on Win7

自闭症网瘾萝莉.ら 提交于 2019-12-07 14:51:39
问题 I have an ASP.Net app .net 3.5 SP1, running in Win7 . During the login process, something within the ASP.Net login control is causing a write to the security log (this sounds acceptable to me) in the event log. The problem is that it seems the app doesn't have permission to do this. There error is: Description : The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or

How do I specify events deep inside “Applications and Services Logs”?

巧了我就是萌 提交于 2019-12-07 14:10:29
问题 The following code snippet fires an event when an event is logged. The sample code works fine but the log I want to monitor is actually "Applications and Services Logs > Microsoft > Windows > Task Scheduler > Operational". What do I insert in place of "Application" in the code sample? ... EventLog myNewLog = new EventLog("Application", ".", "testEventLogEvent"); myNewLog.EntryWritten += new EntryWrittenEventHandler(MyOnEntryWritten); myNewLog.EnableRaisingEvents = true; ... 回答1: The log name

Get-EventLog - valid message missing for some event log sources

自古美人都是妖i 提交于 2019-12-07 05:43:41
问题 I'm pulling and filtering System Event Log data using get-eventlog. What I'm finding is that get-event log is not able to correctly return the message associated with some entries. These entries appear normally in the event log viewer. E.g. get-eventlog -logname system | ? { $_.source -eq "Microsoft-Windows-Kernel-General" } returns 8 entries, all of which have a message of the following form: The description for Event ID '12' in Source 'Microsoft-Windows-Kernel-General' cannot be found. The

Using “Microsoft Windows Security Auditing” provider in real-time consumer with ETW (Event Tracing for Windows)

谁说胖子不能爱 提交于 2019-12-07 01:53:38
问题 My task is to make an ETW real-time consumer with events provided by 'Microsoft Windows Security Auditing'. I made a simple controller and consumer application, basing on this example http://msdn.microsoft.com/en-us/library/windows/desktop/ee441325%28v=vs.85%29.aspx and changing flags to work in real-time mode. The main function looks this way: LPTSTR SessionName = L"hahahaaa"; ULONG status = ERROR_SUCCESS; PEVENT_TRACE_PROPERTIES pSessionProperties = NULL; EVENT_TRACE_LOGFILE trace;

Error while writing to event log, prevents windows service from starting?

孤者浪人 提交于 2019-12-06 20:49:36
问题 I am using the following code to create a custom event log in my windows service application : public ServiceConstructor() { InitializeComponent(); if (!EventLog.SourceExists("WinService")) { EventLog.CreateEventSource("WinService", "WinServiceLog"); eventLog1.Source = "WinService"; eventLog1.Log = "WinServiceLog"; } } protected override void OnStart(string[] args) { eventLog1.WriteEntry("Started"); } After installing the service.msi, when i started the service it started and then stoped.

How can i write to the windows event log using C# (I'm getting some kind of error)?

半世苍凉 提交于 2019-12-06 20:44:25
I have written: . . . //Log exception to the event log if (!EventLog.SourceExists("PodaHIS")) { EventLog.CreateEventSource("PodaHIS", "Application"); } EventLog eventLog = new EventLog(); eventLog.Log = "Application"; eventLog.Source = "PodaHIS"; eventLog.WriteEntry(error.ToString(), EventLogEntryType.Error); I have also enabled read permission to LOCALMACHINE\ASPNET. And in return i get: The source was not found, but some or all event logs could not be searched. Inaccesible logs: Security. Does anyone know why this is happening? HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\EventLog

NT Eventlog single message size

风格不统一 提交于 2019-12-06 19:19:30
问题 Can anybody tell me what is maximum size of a windows NT log message? I know that it is possible to reset the maximum log size of event log from 32 MB. I am interested about the memory a single message can hold in NT event log. Thanks in advance 回答1: In Windows Server 2008 the maximum size of a single Event Log entry is: 31,839 characters http://msdn.microsoft.com/EN-US/library/windows/desktop/aa363679.aspx 回答2: The answer is 32766 characters ~ 32 KB See a example below: Error: Log entry