Pcornel
Windows · Event Logging

Windows Event Log

Cheat sheet · https://pcornel.dk/topic.php?topic=3127

Back to the Topic

Answer

Windows Event Log accepts events from registered providers and stores them in channels backed by EVTX log files or forwarded subscriptions. Applications normally interact through logging APIs rather than writing EVTX files directly.

Remember

  • Providers emit events; channels organize and retain them.
  • EVTX is the native on-disk event log format, not a generic editable text log.
  • Channel configuration controls maximum size, retention/overwrite and whether some logs are enabled.
  • Clearing a log destroys local history and itself may generate audit evidence.
  • Query tools are views over the same underlying event subsystem, not separate truth sources.

First checks

  • Get-WinEvent -LogName System -MaxEvents 50 — recent System events
  • Get-WinEvent -FilterHashtable @{LogName='Application';Level=2;StartTime=(Get-Date).AddHours(-1)} — errors last hour
  • Get-WinEvent -ListLog * | ? RecordCount — logs with entries
  • wevtutil gl <log> — log size and retention

Verify in this order

providers → channels → .evtx files → queried by Event Viewer/Get-WinEvent

Where it usually breaks

First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.

Event Logging → Windows Event Log reference map

BoundaryMeaningEvidence limit
ProviderEmits structured eventsmay write to several channels
ChannelLogical event destinationmay be disabled or size-limited
EVTXNative event storage fileediting/copying is not normal ingestion
RetentionOverwrite/archive behaviormissing old records may be policy
RendererTurns provider data into message textmessage text can depend on local resources

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3127

Confirmation

Confirm action

Continue?