event-log

How to create NTEventlogAppender.dll as required for logging event in the eventlog using log4cplus

ぃ、小莉子 提交于 2019-12-04 16:00:48
First, Let me thank for the log4cplus source code. I am facing one issue as follows: What I am trying to do? I want to log the messages to event log on windows. What did I do? I could get the event logging enabled by in including following .h #include <log4cplus/nteventlogappender.h> And creating the appender as follows: SharedAppenderPtr append_3(new NTEventLogAppender(LOG4CPLUS_TEXT("127.0.0.1"), LOG4CPLUS_TEXT("log"), LOG4CPLUS_TEXT("source"))); append_3->setName(LOG4CPLUS_TEXT("ToEventlog")); Logger to_eventlog = Logger::getInstance(LOG4CPLUS_TEXT("to_eventlog")); to_eventlog.addAppender

Event Logging IPAddress does not always resolve

别说谁变了你拦得住时间么 提交于 2019-12-04 13:00:58
问题 I am hooking the Security event log with System.Diagnostics.Eventing.Reader.EventLogWatcher class, and I am watching Event ID 4625 on a 2008 server box, for incoming failed logins (RDP, specifically). The log capturing is working fine, and I am dumping the results into a queue for related, later processing. However, sometimes the logs captured have the IPAddress data field filled (resolved), and sometimes they do not. I have run windump while watching the server, trying my usual RDP logins

Diagnosing CLR errors in Windows Event Viewer

佐手、 提交于 2019-12-04 08:00:42
We have an .NET desktop application that crashed in production. How do we diagnose the error? I'd like to know the type of exception that occurred, the error message, and the stack trace. Because the exception wasn't handled by our code, we received the "This application has encountered a problem and needs to close" Windows message box. The only option was to close, there was no debug button. This MSDN article suggested looking in the Windows Event registry. I checked there, and here's the information inside it: Faulting application Initect.Server.UI.exe, version 0.12.9084.90, time stamp

How to write an event log entry with structured XML data?

人走茶凉 提交于 2019-12-04 07:48:59
Question: How to write an event log entry with structured XML data using PowerShell? My PowerShell script writes to the Windows event log using the Write-EventLog cmdlet. Currently I use the -Message parameter to set the event log message: Write-EventLog -LogName $EventLogName -Source $EventSource -EntryType Error -EventId 1 -Message "MyMessageHere" If you look at the message using Windows EventViewer you get an XML like this: <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> <System> [...] </System> <EventData> <Data>MyMessageHere</Data> </EventData> </Event> I.e. the

Unhandled IIS Exception - How can I track it down

我与影子孤独终老i 提交于 2019-12-04 04:03:18
I am seeing the following error in the event log. It is coming from our ASP.Net application. I am having trouble tracking down what is causing the error. Any suggestions appreciated! OS : Windows Server 2000 WebServer : IIS 6 Application : ASP.Net v3.5 Error Log [MachineName] has logged the following Error for IIS Details: ComputerName=[ComputerName] User=Not specified Logfile=Application Type=Error EventType=1 SourceName=ASP.NET 2.0.50727.0 Category=0 CategoryString=Not specified EventCode=1334 EventID=-1073740490 TimeGenerated=20091125101806.000000-360 TimeWritten=20091125101806.000000-360

Where is the application dump created by Environment.FailFast() located on the disk?

爱⌒轻易说出口 提交于 2019-12-04 02:44:50
I am trying to use Environment.FailFast() in my application. The MSDN documentation says that it creates an application dump during application termination. The FailFast method writes the message string to the Windows Application event log, creates a dump of your application , and then terminates the current process. The message string is also included in error reporting to Microsoft. Can someone direct me to the location where the dump is created? I used the following code to reproduce the issue: Environment.FailFast("Something bad happened"); You need to add the correct registry entries for

How to determine if an EventLog already exists

筅森魡賤 提交于 2019-12-03 22:05:29
I'm using the following line to create a new event log new-eventlog -LogName "Visual Studio Builds" -Source "Visual Studio" I want to run this every time, because if I run a build from a new computer, I'd still like to see the event logs. The problem is that every time the script is run after the log is already created, it throws an error. New-EventLog : The "Visual Studio" source is already registered on the "localhost" computer. At E:\Projects\MyApp\bootstrap.ps1:14 char:13 + new-eventlog <<<< -LogName "Visual Studio Builds" -Source "Visual Studio" + CategoryInfo : InvalidOperation: (:) [New

Security exception when writting to an EventLog from an ASP.NET MVC application

[亡魂溺海] 提交于 2019-12-03 12:37:28
I have a library that I created with some business logic that includes writing to a System.Diagnostics.EventLog instance. The library is normally called from a Windows Service application, but now I'm trying to call those same library functions from my ASP.NET MVC application. I tried this code inside my controller to create the EventLog instance that I pass into the method that needs to write to the log. Dim log = New EventLog("Application", My.Computer.Name, "MyMVCApp") The following error is generated when the code within the library method tries to write to the log: [SecurityException:

Does one need to manually create a Windows event log source when installing a Windows service

时光总嘲笑我的痴心妄想 提交于 2019-12-03 12:03:17
问题 I have developed a Windows service in C#. I have created a installer with Visual Studio 2008, which installs the Windows service. Everything is good so far. I want to make sure that the event source has been created at install time, so that any error/exception conditions at runtime are correctly logged to the Windows event log. Does the event source get automatically created (and removed) as part of the windows service installation (and uninstallation), or do I have to handle this myself and

ETW, .NET 4.5 - how to write to the event log?

拈花ヽ惹草 提交于 2019-12-03 10:54:35
问题 I am trying to wrap my head around ETW and how to integrate t into a high Performance application. We all know the old dreaded EventLog with it's non structured (and thus not so optimal) API. Now there is a new and fancy API for high performance tracing - ETW, and it got a new API on the .NET side in 4.5 in the form of the EventSource class that you can easily subclass (so no more manifest writing). THis leaves me with a number of questions, trying to get this working. What is the current