event-log

Write to Windows Application Event Log

筅森魡賤 提交于 2019-11-26 23:57:15
Is there a way to write to this event log: Or at least, some other Windows default log, where I don't have to register an event source ? cloud120 Yes, there is a way to write to the event log you are looking for. You don't need to create a new source, just simply use the existent one, which often has the same name as the EventLog's name and also, in some cases like the event log Application, can be accessible without administrative privileges*. *Other cases, where you cannot access it directly, are the Security EventLog, for example, which is only accessed by the operating system. I used this

EventLog write permissions

删除回忆录丶 提交于 2019-11-26 20:48:28
问题 My question is related to write permissions to the Windows Event Log. I have looked around several posts concering this, and have found some ways to solve my problem, but none of these are acceptable for my current scenario. I use C# in .NET 4.0. I use the EventLog class: EventLog class In short, I need to see if there is a way to impersonate or authenticate with an authenticated user and password to reach the right I need to write to the Event Log. The server will always be in the Windows

What is the Fastest way to read event log on remote machine?

谁说胖子不能爱 提交于 2019-11-26 20:15:31
问题 I am working on an application which reads eventlogs(Application) from remote machines. I am making use of EventLog class in .net and then iterating on the Log entries but this is very slow. In some cases, some machines have 40000+ log entries and it takes hours to iterate through the entries. what is the best way to accomplish this task? Are there any other classes in .net which are faster or in any other technology? 回答1: Man, I feel your pain. We had the exact same issue in our app. Your

How to create Windows EventLog source from command line?

只谈情不闲聊 提交于 2019-11-26 19:18:53
I'm creating an ASP.NET application that will log some stuff to Windows EventLog. To do this an event source has to be created first. This requires administrative priviledges so I cannot do it in the ASP.NET app. Is there an existing command-line application that is bundled with Windows that can create an event log source, or must I roll out my own? MSV Muthu Try "eventcreate.exe" An example: eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO MYEVENTSOURCE /D "My first log" This will create a new event source named MYEVENTSOURCE under APPLICATION event log as INFORMATION event type . I think

How do you create an event log source using WiX

半城伤御伤魂 提交于 2019-11-26 18:47:07
I'm creating an installer for a website that uses a custom event log source. I would like our WiX based installer to create that event log source during installation. Does anyone know the best way to do this using the WiX framework. Wix has out-of-the-box support for creating event log sources. Assuming you use Wix 3, you first need to add a reference to WixUtilExtension to either your Votive project or the command line. You can then add an EventSource element under a component : <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

Find out username(who) modified file in C#

此生再无相见时 提交于 2019-11-26 17:56:42
I am using a FileSystemWatcher to monitor a folder. But when there is some event happening in the directory, I don't know how to search who made a impact on that file. I tried to use EventLog. It just couldn't work. Is there another way to do it? I cant remember where I found this code but its an alternative to using pInvoke which I think is a bit overkill for this task. Use the FileSystemWatcher to watch the folder and when an event fires you can work out which user made the file change using this code: private string GetSpecificFileProperties(string file, params int[] indexes) { string

The source was not found, but some or all event logs could not be searched

情到浓时终转凉″ 提交于 2019-11-26 17:36:38
问题 I am getting the following exception. I have given full control to Asp.net account on Eventlogs in Registry edit. [SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.] System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) +664 System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate) +109 System.Diagnostics

C#: GUI to display realtime messages from Windows Service

送分小仙女□ 提交于 2019-11-26 16:37:53
问题 I've written a C# windows service which can write messages to a custom EventLog or to any number of files. These messages are all marked with some priority (so, for example, only ERRORs and WARNINGs get stored in the EventLog, but if desired a lot more can be stored to a file). What I'd like to do now is create a GUI that can listen for these messages and display them in real-time. Allowing a user to watch the current messages (at whatever their desired priority level), without the need to

System.Security.SecurityException when writing to Event Log

蹲街弑〆低调 提交于 2019-11-26 15:45:30
I’m working on trying to port an ASP.NET app from Server 2003 (and IIS6) to Server 2008 (IIS7). When I try and visit the page on the browser I get this: Server Error in ‘/’ Application. Security Exception 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 change the application’s trust level in the configuration file. Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.

Description for event id from source cannot be found

旧巷老猫 提交于 2019-11-26 12:24:55
问题 When I write a log into windows event log, I get the event below, what\'s the root cause of this message, and how can I fix it? Many Thanks The description for Event ID 51001 from source RRWS cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The