TFT2012 Posted February 25, 2013 Share Posted February 25, 2013 Hi all, Are we able to make Apache create the access_log each month automatically? I tried like this: CustomLog "logs/access/access_log_%{year_month}t" common or CustomLog "logs/access/access_log_%Year-%month" common or CustomLog "logs/access/access_log_%Y-%m" common But it returns me the file name just like " access_log_%{year_month}t ". Can anyone help? Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/274925-how-to-create-apache-access-log-each-month-automatically/ Share on other sites More sharing options...
requinix Posted February 25, 2013 Share Posted February 25, 2013 Had you looked at the manual before blindly trying random things you would have seen a note about piped logs. Related, here is the manual page for rotatelogs which demonstrates how you can have a daily log file; I think it will append to existing files so you could write the filename to be per-month and use a per-hour interval (to handle DST changes). Quote Link to comment https://forums.phpfreaks.com/topic/274925-how-to-create-apache-access-log-each-month-automatically/#findComment-1414872 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.