logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Issue with mod_log_rotate-1.0.2-win64-VS18
Author
Snits



Joined: 09 Jan 2026
Posts: 2
Location: Amsterdam, NL, EU

PostPosted: Fri 09 Jan '26 13:27    Post subject: Issue with mod_log_rotate-1.0.2-win64-VS18 Reply with quote

OS: Windows 11
Apache version: 2.4.66
PHP v8.5.1: using PHP handler (php8apache2_4.dll instead of mod_fcgid)

What I’ve done:
    - Replaced Apache v2.4.66-251206-win64-VS17 with v2.4.66-260107-Win64-VS18
    - Replaced module mod_security-2.9.11-win64-VS17 with mod_security-2.9.12-win64-VS18
    - Replaced module mod_evasive-2.4.0-win64-VS17 with mod_evasive-2.4.0-win64-VS18
    - Replaced module mod_log_rotate-1.0.2-win64-VS17 with mod_log_rotate-1.0.2-win64-VS18


Result:
    - Everything works fine except the mod_log_rotate-1.0.2-win64-VS18 module
    - The mod_log_rotate-1.0.2-win64-VS18 doesn’t convert variables anymore and produces log files like “access_%Y%m%d.log” instead of “access_20260108.log”. The content of these files look OK though. So it’s a filename issue only.


Workaround:
    - Using mod_log_rotate-1.0.2-win64-VS17 instead of mod_log_rotate-1.0.2-win64-VS18 in the Apache v2.4.66-260107-Win64-VS18 installation solves the issue. Now it produces files like “access_20260108.log” again instead of “access_%Y%m%d.log”.


Looks like a bug in mod_log_rotate-1.0.2-win64-VS18 to me. Has anyone else had the same experiences?
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 415
Location: UK

PostPosted: Sun 11 Jan '26 21:15    Post subject: Reply with quote

I'm able to reproduce your problem with the latest VS18 release of mod_log_rotate and HTTPD downloads, but I can't explain it.

Firstly, I'm assuming your configuration file enables the log_rotate_module (not present in the default httpd.conf file), without which you will get the % characters in your log filenames.
Code:
LoadModule log_rotate_module modules/mod_log_rotate.so

Secondly, and more importantly, I found that if I explicitly enable log rotation in the configuration file, then for me it works.
Code:
RotateLogs On

That's despite the module code supposedly enabling log rotation by default, viz:
Code:
static void *make_log_options(apr_pool_t *p, server_rec *s) {
    log_options *ls;

    ls = (log_options *) apr_palloc(p, sizeof(log_options));
    ls->enabled     = 1;
    ls->interval    = INTERVAL_DEFAULT;
    ls->offset      = 0;
    ls->localt      = 0;

    return ls;
}

What I have noticed is this module uses apr_palloc() to allocate memory for the above configuration settings, whilst other modules seem to use apr_pcalloc(), the difference being the latter initializes all bytes to zero. This, plus other compiler optimization differences between VS17 and VS18 is the only thing I can think of that might explain the effect you're seeing.

If I have time, I might try compiling mod_log_rotate with apr_pcalloc() to see if it makes any difference.

Out of interest, I tend to use the rotatelogs.exe binary in a piped configuration, rather than mod_log_rotate, not least of which you can then rotate the error log files too, e.g.
Code:
ErrorLog "| C:/Apache24/bin/rotatelogs.exe C:/Apache24/logs/error_%Y-%m-%d.log 86400"
CustomLog "| C:/Apache24/bin/rotatelogs.exe C:/Apache24/logs/access_%Y-%m-%d.log 86400" combined
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7455
Location: EU, Germany, Next to Hamburg

PostPosted: Mon 12 Jan '26 10:11    Post subject: Reply with quote

If you have a better solution, please open a PR on https://github.com/JBlond/mod_log_rotate
Back to top
Snits



Joined: 09 Jan 2026
Posts: 2
Location: Amsterdam, NL, EU

PostPosted: Mon 12 Jan '26 13:50    Post subject: Reply with quote

Quote:
Firstly, I'm assuming your configuration file enables the log_rotate_module (not present in the default httpd.conf file), without which you will get the % characters in your log filenames.
Code:
Code:   
LoadModule log_rotate_module modules/mod_log_rotate.so

Yes I did.

Quote:
Secondly, and more importantly, I found that if I explicitly enable log rotation in the configuration file, then for me it works.
Code:
Code:   
RotateLogs On

I can confirm this solves the issue.

Quote:
Out of interest, I tend to use the rotatelogs.exe binary in a piped configuration, rather than mod_log_rotate, not least of which you can then rotate the error log files too, e.g.
Code:
Code:   
ErrorLog "| C:/Apache24/bin/rotatelogs.exe C:/Apache24/logs/error_%Y-%m-%d.log 86400"
CustomLog "| C:/Apache24/bin/rotatelogs.exe C:/Apache24/logs/access_%Y-%m-%d.log 86400" combined

This is a very interesting remark because with some of my hosted sites I already used a piped configuration for ErrorLog. Now I've changed my .conf files to make consistent use of piped configurations for all of my hosted sites (ErrorLog ànd CustomLog). Indeed, in this way I don't have to make use of mod_log_rotate anymore.

Disadvantage of making use of a piped configuration (for CustomLog) compared to mod_log_rotate: the process table is cluttered up with an instance of rotatelogs for each virtual server

Many thanks for your answer tangent!
Back to top


Reply to topic   Topic: Issue with mod_log_rotate-1.0.2-win64-VS18 View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules