How to limit logs in event viewer?

hendri yu 66 Reputation points

Dear Expert,

Good Day

May i know how to limit the windows log in event viewer to something like 1 or 2 weeks? Meaning that after 1-2 weeks it will overwrite the old log in order to reduce the log size that keep growing and save some space.


Windows Server 2012
Windows Server 2012
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
1,538 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dave Patrick 426.2K Reputation points MVP

    There isn't an option to limit by time stamp. You can limit the log by file size.


    --please don't forget to Accept as answer if the reply is helpful--

  2. Mico Mi 1,921 Reputation points

    You can take a look at these docs about Limit-EventLog cmd:
    The Limit-EventLog cmdlet sets the maximum size of a classic event log, how long each event must be retained, and what happens when the log reaches its maximum size. You can use it to limit the event logs on local or remote computers.
    OverflowAction specifies what happens when the event log reaches its maximum size. The acceptable values for this parameter are:

    • DoNotOverwrite: Existing entries are retained and new entries are discarded.
    • OverwriteAsNeeded: Each new entry overwrites the oldest entry.
    • OverwriteOlder: New events overwrite events older than the value specified by the MinimumRetentionDays property. If there are no events older than specified by the MinimumRetentionDays property value, new events are discarded.

    If you want to save some space, you can also use the following methods to adjust event log size:

    Thanks for your time!
    Best Regards,
    Mico Mi


    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments