What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To handle web-server logs on a 24-hour cycle, configure two separate controls: rotate the active log into a new file every day, then expire older rotated files with an explicit age or count rule. Rotation alone creates new files but does not necessarily delete everything older. Apache can rotate through rotatelogs with an 86,400-second interval; Linux installations commonly use scheduled logrotate rules for NGINX; and IIS exposes a Daily log-file period. Set retention independently so deletion remains compatible with incident response, privacy, security and legal requirements.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
The procedures below keep the active file safe, ensure the server writes to the new file, and give you a testable policy for single servers or a fleet.
As an Amazon Associate I earn from qualifying purchases.
What a 24-hour log policy actually does
A daily policy has two events. First, the server or an operating-system service closes, renames, copies or replaces the current access and error logs. Second, a retention rule removes files that have passed the chosen age or count limit. Treating those events separately prevents a common failure: a server rotates perfectly while old files accumulate until the disk is full.
Rotation is not deletion
Rotation determines when a fresh file starts receiving entries. A rule such as Apache’s 86,400-second interval or IIS’s Daily period answers the question, “When should the next file begin?” It does not, by itself, establish how many historical files remain. Add a count such as 20 rotations, or an age such as 30 days, and document the reason for that value.
#1 Best Overall
Protect the active file
Never delete the file a worker is actively writing. A safe sequence identifies the real access and error-log paths, starts a new destination, makes the server reopen that destination when required, and only then removes files that satisfy the retention rule. If an external utility moves a file without a reopen, the daemon may continue writing to an unlinked or renamed handle, making the apparent new file stay empty.
Choose retention before configuring automation
The correct retention period is organization-specific. Security investigations may need more history than routine operations; privacy rules may require earlier disposal; and regulated environments can impose their own records schedules. There is no universal legal number of days without knowing the jurisdiction, industry and data in the logs.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →| Policy choice | What you configure | When it is useful | Main trade-off |
|---|---|---|---|
| Age-based | Delete files older than a stated number of days | Predictable time window for incident response and privacy reviews | Disk usage varies with traffic volume |
| Count-based | Keep a stated number of rotations, such as 20 | Bounded file count and simple operational rules | Actual days retained change with traffic or missed rotations |
| Age plus count | Delete when either limit is exceeded | Teams needing both a minimum history and a hard disk-safety ceiling | Requires documenting which limit triggered deletion |
| Archive before deletion | Compress or copy logs to an approved store, then expire the local copy | Longer investigations or compliance workflows | Introduces transfer, access-control and restore responsibilities |
Write the selected limit beside the configuration, including its owner and review date. If a one-day retention truly is required, define whether “24 hours” means elapsed time from each file’s creation or the daily scheduler’s calendar boundary. Those are not always the same.
Apache HTTP Server: rotate with rotatelogs
Apache documents piped logging through rotatelogs. Passing 86400 seconds sets a 24-hour rotation interval. The process starts a new file at the interval boundary while Apache continues serving requests.
Configure access and error logs
In the virtual-host or server configuration, adapt the documented pattern to your binary and log directories:
CustomLog "|/usr/local/apache/bin/rotatelogs /var/log/httpd/access_log 86400" combined
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #2
ErrorLog "|/usr/local/apache/bin/rotatelogs /var/log/httpd/error_log 86400"
The first line sends combined-format access entries to a piped logger; the second applies the same interval to errors. Use the paths that your installation actually owns rather than copying these locations blindly. Apache also documents date-formatted filenames, which can make daily files easier to identify during an investigation. Confirm the resulting names on your platform before writing cleanup rules that depend on a pattern.
Do not confuse rotation with expiry
The 86,400-second value tells rotatelogs when to create the next file. Add a separate cleanup mechanism if your policy requires old files to disappear. An operating-system scheduler can remove files older than the approved age, or a count-based tool can retain only the specified number. Make the cleanup pattern narrow enough to match archived Apache logs and never the current destination.
When an external tool moves Apache files
If you use a utility that renames or replaces files outside Apache, send httpd a graceful reload or reopen action after the move. Apache’s documentation warns that httpd “continues writing to the old file handle until it receives the signal.” Without that step, the newly named file may remain at zero bytes while the process writes to the old handle.
Apache verification
- Check the active configuration and confirm that both
CustomLogandErrorLogpoint to the intended destinations. - Record the ownership and mode of the directory and files; the account running Apache must be able to create the next file.
- After a scheduled boundary or a controlled test, make a request and generate a deliberate error so both logs receive fresh entries.
- Verify that a new file appears, that its timestamps and name match your time-zone expectations, and that the old file stops growing.
- If an external move was involved, perform the documented graceful reopen and repeat the request test.
Linux hosts and NGINX: use the scheduled logrotate service
NGINX documentation describes a typical arrangement in which the host runs logrotate periodically from cron or another scheduler. The rule controls when files are rotated, how many generations remain and how the new file is created. The scheduler’s actual run time determines when the daily action occurs; “daily” does not guarantee a particular clock minute.
Understand the important directives
daily: asks the scheduler to process the rule once per day.rotate 20: keeps 20 rotations before older generations are removed. Replace 20 with the count your policy approves.copytruncate: copies the current file and truncates it in place, allowing NGINX to keep its existing handle. This avoids a reopen action but has a brief handoff window.create: creates a replacement file with the specified ownership and mode. When using replacement files, ensure NGINX reopens its logs through the post-rotation action supplied by your distribution.
copytruncate and create represent different strategies; select the one that matches your distribution’s NGINX rule instead of enabling both without testing.
Rank #3
- Upgraded Two Zipper Pockets: Forvencer server books feature two secure zipper pockets for better organization of coins, cash, and receipts, ensuring that everything you collect has a safe and secure place
- Smart Storage & Quick Access: Designed with 8 multi-functional compartments, the right side includes a guest receipt pad, while the left has a money pocket, ticket pocket, and credit card slot. Two small clear pockets store bills, receipts, and other visible items. A stitched pen loop ensures you always have your favorite pen ready
- High-quality & Easy to Clean: Crafted from high-quality PU leather with heavy-duty stitching, this server book is built to last. It resists tears, scratches, and its waterproof surface makes cleaning easy with just a damp cloth or a non-chlorine sanitizer
- Perfect Fit for Your Apron: Measuring 5” x 8”, this compact organizer is slightly smaller than other models, making it ideal for bending or sitting while carrying in your server apron. It holds everything a waitress needs—a place for everything
- What's Included: This server organizer comes with multiple open and zippered pockets to store money, receipts, tips, etc. Clear sleeves are perfect for keeping menus or special lists while serving. Available in a variety of colors, allowing you to express yourself even when in uniform
Build a rule for the real paths
A minimal shape, adapted to your installation, is:
/var/log/nginx/*.log { daily rotate 20 missingok notifempty compress copytruncate }
This example illustrates the documented controls: daily scheduling, a 20-file count, optional compression and in-place truncation. Replace the glob with the actual access and error-log paths. If your policy is age-based, use the age directive supported by your installed logrotate version and state the number of days explicitly. If you choose create instead of copytruncate, retain the ownership and mode expected by NGINX and include the package’s reopen action.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteTest without waiting for midnight
- Locate the active rule, commonly under the host’s
logrotateconfiguration directory, and read the included files to ensure another rule is not also matching the same logs. - Run a debug or dry-run mode first so syntax and matched paths are displayed without changing files.
- Force one controlled rotation during a maintenance window, then send requests that create access and error entries.
- Confirm that the new file receives entries, the archived generation has stopped changing, compression behaves as intended and the count or age rule removes only eligible files.
- Check the cron or systemd timer that invokes
logrotate. It must run with permission to read, rename, create and remove the selected files.
IIS: set daily rollover, then add expiry
Microsoft’s IIS <logFile> settings expose a period attribute. Daily creates a new log file every day and is the documented default period for IIS site defaults. Other choices are Hourly, Weekly, Monthly and MaxSize. The same settings document truncateSize for size-based rollover.
Set the rollover period
At the site-default level, the configuration shape is:
<siteDefaults><logFile period='Daily' /></siteDefaults>
Apply the equivalent setting to an individual site when different sites need different schedules. In IIS Manager, open the target site’s logging configuration and set the log-file rollover period to Daily, then apply the change. Verify the generated directory and filename convention before creating an automated deletion filter.
Use size rollover only when it solves a separate problem
MaxSize or truncateSize can prevent a very busy site from producing an unwieldy single file, but size rollover is not a substitute for a 24-hour schedule. If you need both limits, keep the daily period and add the documented size threshold, then test which event wins when the file reaches the threshold shortly before midnight.
Add a deliberate cleanup task
Daily IIS rollover creates new files; it does not establish your organization’s deletion period. For an age-based policy, create a scheduled PowerShell task that targets only archived IIS log files and records what it removes. For example, after replacing the directory and retention value with approved settings:
$cutoff = (Get-Date).AddDays(-30); Get-ChildItem -Path 'C:inetpublogsLogFiles' -File -Recurse | Where-Object { $_.LastWriteTime -lt $cutoff } | Remove-Item -Force
Run the task under an account that can read and delete the files, and initially use a reporting mode that writes matching paths to an audit log instead of deleting them. Exclude the current day’s file if your policy requires a complete 24-hour window, and ensure the filter cannot reach application data or another site’s directory.
A safe implementation sequence for any server
- Inventory paths. Identify every access, error, proxy and module log that the server writes. Record whether a site-level override changes the global default.
- Identify the writer. Confirm the service account, directory owner, group and file mode. A rotation job that runs as the wrong user may create unreadable files or fail to remove old ones.
- Choose the boundary. Decide whether the policy follows elapsed 24-hour intervals, a local calendar day or the scheduler’s daily run. Record the time zone, including daylight-saving behavior.
- Configure native rotation. Use Apache
rotatelogs, the host’s NGINXlogrotaterule or IISperiod='Daily'as appropriate. - Configure expiration separately. Select age, count or both. Include compression only if the resulting files remain readable to the people and tools that need them.
- Handle reopening. Apache requires a graceful reopen after an external move. For NGINX replacement-file rules, use the reopen action provided by the installed package. IIS writes to its newly rolled file through its own logging subsystem.
- Test immediately. Rotate once under supervision, create known access and error events, and verify that the new file grows.
- Observe the next scheduled run. Check scheduler status, exit codes, service logs, disk usage and the age of the oldest retained file.
- Document recovery. Keep the exact configuration, retention rationale and restore procedure with the system’s runbook.
Apache, NGINX and IIS compared
| Server | Daily mechanism | Reopen consideration | Retention control | Filename and time-zone notes | Compression and permissions |
|---|---|---|---|---|---|
| Apache HTTP Server | rotatelogs with 86400 seconds, or an external rotation service |
Graceful reload or reopen is required after an external move because httpd can keep the old handle | Configure separately with an age or count cleanup policy | Date-formatted names are documented; verify local boundary and naming before filtering | Set directory and file access for the Apache account; compression belongs to the cleanup/archive layer |
| NGINX on Linux | Scheduled host logrotate rule using daily |
copytruncate avoids a reopen; create requires the distribution’s NGINX reopen action |
rotate N expresses a count; use an age directive when elapsed days matter |
The cron or systemd timer controls the actual run time; inspect generated names on the host | compress is available in the rule; create must specify suitable ownership and mode |
| IIS | <logFile period='Daily' /> |
IIS manages its own daily file rollover; external scripts must avoid the active file | Add a separate scheduled age- or count-based cleanup task | Daily is the documented default; confirm the site’s directory and local time behavior | Run cleanup with an account permitted to remove files; archive or compress before deletion if required |
Common failures and precise fixes
A new file never appears
Check that the scheduler actually ran, that the interval or period is attached to the active site or virtual host, and that the process can create files in the directory. For NGINX, inspect both the included logrotate files and the timer that invokes them. For IIS, verify that the setting was applied to the site receiving traffic rather than only to an unused default.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallThe new file exists but stays empty
This usually indicates a handle or reopen problem. Apache may still be writing to the old handle after an external move; perform the graceful reopen and generate a test request. With NGINX, either use copytruncate or ensure the replacement-file rule invokes the package’s reopen action.
Old files never disappear
Rotation and deletion are separate. Confirm that a retention directive or cleanup task exists, that its pattern matches archived names, and that the scheduler account can remove them. Review dry-run output before broadening a pattern; a glob that matches the active file is unsafe.
Best Value
Logs disappear too soon
Check whether a count limit is being interpreted as days. A count of 20 can represent fewer than 20 days if multiple rotations occur, while missed scheduler runs can make it represent more. Check overlapping cleanup jobs and verify the server’s clock and time zone before changing the policy.
Permission or ownership errors appear
Inspect the directory execute/write permissions, the service account, any mandatory access-control policy and the ownership requested by a create directive. A successful rotation performed by root can still leave a file that the web server cannot write.
Recommended Free Tools
Only one node rotates correctly
Compare configuration, timer schedule, time zone, service account, directory ownership and retention rules on every node. A load balancer can send traffic to a node whose logs are not being rotated, so monitor disk usage and last-write time per host rather than checking one machine.
Operating a daily policy across multiple web nodes
Apply the same documented policy to each node, but keep files local unless your architecture explicitly centralizes them. Local rotation should continue to work if a network destination is unavailable. If logs are copied to a central store, define whether local deletion occurs only after a successful transfer and how failed transfers are retried.
Use configuration management or an equivalent repeatable process to distribute the rule, then verify node-specific paths and service identities. Record the scheduler’s time zone so a fleet does not rotate at unexpectedly different boundaries. Alert on the oldest local file, free disk space and the age of the last successful rotation.
Verification checklist
- Every active access and error log has one clearly identified rotation owner.
- The daily interval or period is configured on the server that actually receives requests.
- Retention is stated as an age, count or both, with a documented business reason.
- The cleanup pattern cannot match the active file, configuration files or another application’s data.
- Apache receives a graceful reopen after an external move; NGINX replacement rules invoke the installed reopen action.
- New files have the intended owner, group and mode, and the service can append to them.
- A controlled test proves that requests appear in the new file immediately after rotation.
- The scheduler runs with the required permissions and reports failures where operators will see them.
- Compression, archival and deletion have a restore or investigation procedure.
- Each web node is checked independently for disk pressure and stale handles.
When a 24-hour deletion rule is the wrong policy
Deleting everything older than one day can remove evidence needed to diagnose a breach, intermittent outage or abuse report. It can also conflict with a documented retention schedule. If short local retention is required for privacy or disk limits, archive the approved fields or compressed files to a controlled system before local expiration, and restrict access to that archive. If logs contain personal data, minimize what is recorded at the source rather than relying on deletion as the only privacy control.
Review the policy whenever traffic volume, application behavior, legal obligations or incident-response requirements change. A daily rotation is an operational cadence; it is not, by itself, a security, privacy or compliance decision.
Final implementation decision
Use Apache’s rotatelogs with 86400 when Apache should own the daily boundary, use the host’s scheduled logrotate service for NGINX, and set IIS’s logFile period to Daily. Then add and test a separate expiration rule, reopen the daemon when an external move requires it, and monitor every node. That combination creates a new log every 24 hours without allowing unbounded historical files or silently starving the server of writable logs.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




