Questions tagged [event-viewer]

Event Viewer - tool in Windows systems that allows users to inspect the event logs.

Event Viewer - tool in Windows systems that allows users to inspect the event logs.

353 questions
3
votes
4 answers

Windows Service cannot create a text file

Ok so this is my code for the OnStart method File.CreateText("test.txt"); StreamWriter write = File.AppendText("test.txt"); write.WriteLine("Hello world, the service has started"); write.Flush(); write.Close(); I am successfully able to install the…
Win Coder
  • 6,628
  • 11
  • 54
  • 81
3
votes
2 answers

Example of source for NTEventLogAppender?

I'm trying to learn how to log from java eclipse to event viewer and I've read the api, various sites and similar questions on stack overflow. But when I follow the steps I always get: Exception in thread "main" java.lang.UnsatisfiedLinkError:…
user1479897
  • 145
  • 2
  • 11
2
votes
1 answer

Event viewer create Event ID C#

Is it possible to create an Event ID linked to an error from C# debugging system? I'm currently writing my code -which still has a small error, click here- for making up really detailed error logs in the event viewer
Dashzapp
  • 123
  • 4
  • 13
2
votes
1 answer

Powershell - Efficient way to pull event viewer logs

Currently it takes 15-20 seconds to pull specific event viewer logs, is there a more efficient way to accomplish the same end result? I need the last 5 minutes' worth of application logs for Instance ID 21. Start-Transcript -Path…
BCon995
  • 135
  • 6
2
votes
0 answers

Create Custom Log in Event Viewer with C++

I want to be able to create a custom log in event viewer (i.e. to create a custom node under "Application and Services Logs" in windows event viewer) It is an easy task, if you use EventLog.CreateEventSource method: LINK Its problem is that this…
RezaPlusPlus
  • 545
  • 1
  • 8
  • 18
2
votes
0 answers

How do I add spaces to folder names being created in Event Viewer > Application and Services logs?

Currently, I'm using EventSourceAttribute to create a hierarchy of subfolders in Application and Services log in Event Viewer. This is my code [EventSource(Name = "Service-MacClient-EventSource")] public sealed class MinimalEventSource :…
John Evans Solachuk
  • 1,953
  • 5
  • 31
  • 67
2
votes
1 answer

Is it possible to automate saving event viewer errors as text files?

I currently spend a considerable amount of time copying and pasting event viewer logs into text files and then copying them to a repository on another computer. Is it possible to automate the saving these event viewer logs between a specified…
2
votes
1 answer

Windows Event Viewer giving cryptic string values for its attributes in XML mode

I am trying to log windows defender events from Event Viewer using C# .net framework. When I try to capture Event data attribute values via reading XML it gives me weird string values for some attributes like Origin Name, Execution Name, Type Name,…
Pratik Patil
  • 101
  • 1
  • 5
2
votes
1 answer

How to create a event log at "Application and Services Logs" section using c++

I want to write logs in Event viewer under "Applications and Services logs"section using c++. But I cannot find any interface about it, Does anybody know? I have tried "RegisterEventSource", "ReportEvent", but i can only write event viewer logs in…
2
votes
2 answers

How can I open Event Viewer from a web page using c#?

I have a requirement where I need to just open an Event Viewer to the internal users from an internal webpage. I have a link "Evetn Viewer" and a dropdown "Servers", when user select a server and click the link, I want to open the windows event…
Sri Reddy
  • 6,832
  • 20
  • 70
  • 112
2
votes
2 answers

Trigger powershell based on event log

I have a command line argument script written in PowerShell which accepts server name from the task scheduler. However my requirement is to execute the script when the SQL server is restarted, hence I have attached the PowerShell script to the event…
SQLDoctor
  • 343
  • 7
  • 16
2
votes
1 answer

ASP.NET Core 2.0 EventLog change Application name in Event Viewer

I have an ASP.NET Core 2.0 application using Microsoft.Extensions.Logging.EventLog to log to Windows Event Viewer with .ConfigureLogging((hostingContext, logging) => { logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); …
2
votes
1 answer

How to write in .evtx file c#

I want to write event log. I have performed a query. And its returning expected result. Now, I want to write in that result in evtx file. here is my code: List eventList = new List(); for (EventRecord eventInstance =…
2
votes
1 answer

New Windows log not displaying in Windows Event Viewer

I want to create a new Windows log in Windows event viewer, everything seems to be fine but the log is not displaying. The source is being populated in Application log instead of the one I'm trying to create Sample code if…
2
votes
2 answers

windows event viewer order by date time

I need to check events for debuging a service that has many events . Windows event viewer sorts events by date time but there is a big problem. for example event 1 time is 12:32:11 events 2 time is 12:32:11 events 3 time is also 12:32:11 event 2 is …
Shahram Banazadeh
  • 500
  • 1
  • 5
  • 15