{
	"id": "04ef74f3-ab74-425c-a6bd-a5729d8332fe",
	"created_at": "2026-04-06T00:18:36.181254Z",
	"updated_at": "2026-04-10T03:20:03.116539Z",
	"deleted_at": null,
	"sha1_hash": "fc4103bdf7986a1f62dcc3de02cf2e3123a06a28",
	"title": "EventLog.Clear Method (System.Diagnostics)",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 43525,
	"plain_text": "EventLog.Clear Method (System.Diagnostics)\r\nBy dotnet-bot\r\nArchived: 2026-04-05 20:36:48 UTC\r\nImportant\r\nSome information relates to prerelease product that may be substantially modified before it’s released. Microsoft\r\nmakes no warranties, express or implied, with respect to the information provided here.\r\nRemoves all entries from the event log.\r\nC#\r\npublic void Clear();\r\nThe event log was not cleared successfully.\r\n-or-The log cannot be opened. A Windows error code is not available.\r\nA value is not specified for the Log property. Make sure the log name is not an empty string.\r\nThe log does not exist.\r\nThe following example clears an event log.\r\nCaution\r\nBecause Application, System, Security, and other non-custom logs can contain crucial information; be sure to\r\nspecify a custom log before executing this example code. This example deletes the custom log myNewLog .\r\nC#\r\nusing System;\r\nusing System.Diagnostics;\r\nusing System.Threading;\r\nclass MySample{\r\n public static void Main(){\r\n // Create an EventLog instance and assign its log name.\r\n EventLog myLog = new EventLog();\r\nhttps://msdn.microsoft.com/library/system.diagnostics.eventlog.clear.aspx\r\nPage 1 of 2\n\nmyLog.Log = \"myNewLog\";\r\n myLog.Clear();\r\n }\r\n}\r\nEvent logs are set with a maximum size that determines how many entries they can contain. When an event log is\r\nfull, it stops recording new event information or begins to overwrite earlier entries. If event recording stops, you\r\ncan use this method to clear the log of existing entries and allow it to start recording events again. You must have\r\nadministrator permissions to the computer on which the log resides to clear event log entries.\r\nClear closes the event log, releases the event handles, retrieves new read and write handles, and reopens the event\r\nlog. Events received after the call to the method are not cleared along with the existing events.\r\nProduct Versions\r\n.NET 10 (package-provided), 11 (package-provided)\r\n.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1\r\n.NET Standard 2.0 (package-provided)\r\nWindows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10, 11\r\nClose()\r\nDelete(String)\r\nSource: https://msdn.microsoft.com/library/system.diagnostics.eventlog.clear.aspx\r\nhttps://msdn.microsoft.com/library/system.diagnostics.eventlog.clear.aspx\r\nPage 2 of 2",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://msdn.microsoft.com/library/system.diagnostics.eventlog.clear.aspx"
	],
	"report_names": [
		"system.diagnostics.eventlog.clear.aspx"
	],
	"threat_actors": [],
	"ts_created_at": 1775434716,
	"ts_updated_at": 1775791203,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/fc4103bdf7986a1f62dcc3de02cf2e3123a06a28.pdf",
		"text": "https://archive.orkl.eu/fc4103bdf7986a1f62dcc3de02cf2e3123a06a28.txt",
		"img": "https://archive.orkl.eu/fc4103bdf7986a1f62dcc3de02cf2e3123a06a28.jpg"
	}
}