• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Log rotation and statistics settings

Pleskie

Regular Pleskian
Hi,

I have a few questions about log rotation and statistics settings. I numbered the questions so they can (hopefully) easily be replied.

To me it looks as if there is some overlap in settings (but I'm probably wrong). Who can clarify?

Tools & Settings > General Settings > Server Settings

Question 1.

Retain web and traffic statistics for - 3 Months

Are these statistics that are required to show the traffic in AWStats? If I change it to (for example) 2 months, does that mean I can only see AWStats statistics of the last 2 months and will all statistics before that date be deleted? And why whould I choose to retain the statistics for (for example) 12 months? How would that benefit me? Or wouldn't it?

Question 2.

Log rotate - Force daily log rotation for all domains
Allow storing site log files for 7 days


What exactly does this mean? Does this mean that each log file is deleted after 7 days? That is what the documentation seems to imply. But I don't get it. Does this overrule the setting in Question 1?

Service Plans > Default Domain > Logs & Statistics

Question 3.

Retain web and traffic statistics for 3 months

Is this the same setting as in Question 1?

Question 4.

Log rotation condition by time / by size
Maximum number of log files 10


How does this setting relate to the setting in Question 2?

I would appreciate if someone could clarify. Many thanks in advance.
 
1) AWStats takes the log before log rotation to create statistics and stores the data separately. If the log files are deleted or rotated, they do not influence AWStats.
2) Part a: "Force daily" means, that logs will for sure be rotated daily, even if their content is so small that they would normally not be rotated by size threshold.
Part b: I don't know, but assume that rotated log files are stored for 7 days.
3) I don't know. Where has the quote been taken from?
4) Whichever is reached first will be done. If the log file size exceeds the limit, a rotation can take place earlier (if the nightly log file rotation job is executed), else log files will be rotated daily. If you don't add custom "nightly" maintenance windows during daytime, it's basically the case that log files will be roated daily.
 
Hi @Peter Debik

Thanks for replying.

1) If it does not influence AWStats, what could be a reason to retain statistics more than 1 month? For example, why would it benefit me to keep the logs for 3 months instead of 1 month?

2) Okay, I get what you are saying. But are these different logs than in the previous question (I mean the web statistics logs in Question 1)?

3) "Where has the quote been taken from?" Which quote do you mean?

4) Okay I get what you are saying. (I think it's a bit weird though. If I set the log rotation here to 1 month, than it will be overruled if I force daily log rotation. It seems conflicting.)
 
1) If it does not influence AWStats, what could be a reason to retain statistics more than 1 month? For example, why would it benefit me to keep the logs for 3 months instead of 1 month?
We have used 1 month as the setting here, ever since we started. No tangable reason not to (that we're aware of)
2) Okay, I get what you are saying. But are these different logs than in the previous question (I mean the web statistics logs in Question 1)?
Similar to the above, we've used 3 days as the setting here, ever since we started, but, we have also made our own changes to log rotation elsewhere to cover other logs too. However, where logs were / are controlled by Plesk, after 3 days, they are deleted as expected.
3) "Where has the quote been taken from?" Which quote do you mean?
Think that's just a misunderstanding. You've shown where it's come from: Service Plans > Default Domain > Logs & Statistics when in 'Service Provider View' but maybe, that detail should have been shown below the Question 3 heading, not above it, in your post, so as to confirm which question it was related to?
4) Okay I get what you are saying. (I think it's a bit weird though. If I set the log rotation here to 1 month, than it will be overruled if I force daily log rotation. It seems conflicting.)
The explanation given by @Peter Debik is correct / makes perfect sense to us, but see the following for further ref!
To be fair, the whole subject of log rotation is a bit more complex / involved than is 1st perceived. Especially when adding Plesk in as an administrative factor to some, but not all logs (e.g. Check your own specific MariaDB / MySQL setup(s) and then have a look here: /var/log/mysql). If you're happpy to apply custom settings (sometimes... on a trial and error basis, until you get it 100% correct!) you can achieve exactly what you want with log rotate. It's not black hat stuff, but... very clear explanations / methods to be used on your own server setup are not always easy to find and/or not straightforward to apply, in several cases.
 
Thanks for taking time to reply @learning_curve

Looking further into it ... I think Question 1 and 2 are only about domain related log files and not about system log files. I think these are general settings which overrule the settings in Question 3 and 4. If I do not enable 'Log rotate - Force daily log rotation for all domains' I assume the settings in Question 4 are being used. I think ... not 100% sure though.

I find it quite unclear to be honest. The setting in Question 1 and 3 is the exact same one. So weird. Which one is being used? If I set Question 1 to 1 month but Question 3 to 6 months, will the log then be rotated after 1 or 6 months? Or will it not be rotated but deleted? I'm not sure I totally get it :confused:
 
The setting in Question 1 and 3 is the exact same one. So weird.
Not always... Depends on how you have setup your own service plans / domains / templates etc as that could / would make a difference between the two
Which one is being used? If I set Question 1 to 1 month but Question 3 to 6 months, will the log then be rotated after 1 or 6 months? Or will it not be rotated but deleted? I'm not sure I totally get it :confused:
See above, then perhaps; step away from it, note all settings: which domain / which service plan / which settings etc and adjust accordingly / monitor the results. It should then become a lot clearer. The only caveat being; Plesk doesn't control ALL logs / log rotation settings, so watch for any false positive results
 
@learning_curve

"Depends on how you have setup your own service plans / domains / templates etc as that could / would make a difference between the two"

Could you explain this or give an example? Settings seem the exact same to me . Which one will be followed if 1 is set to 1 month and the other to 6 months?

"Plesk doesn't control ALL logs / log rotation settings, so watch for any false positive results"

This is what makes it unclear. Plesk should indicate which logs will be modified. And they should indicate which settings are general or domain specific ... and what happens if these settings differ.
 
Could you explain this or give an example? Settings seem the exact same to me
A bit tricky for anybody to give an example taken from your setups / server... ;) but, you could raise a service ticket with Plesk / give them server access & they could advise you further, with regard to your own setups and your own Plesk managed areas of logs / log rotation etc. Post #5, especially the last section, is pretty self-explanatory though, so what's stopping you from investigating all of this yourself, in detail, on your own setups / server? You will have regular backups / server shapshots to fall back on, if you have certain logs that you need / are concerned about losing etc so there's nothing to stop you really, is there?
Which one will be followed if 1 is set to 1 month and the other to 6 months?
See above
This is what makes it unclear. Plesk should indicate which logs will be modified. And they should indicate which settings are general or domain specific ... and what happens if these settings differ.
Not here to defend Plesk. They have their own set ways, for all of us Plesk users to request changes / enhancements / improvements etc
The 1st repsonse above, plus Post #5, especially the last section, again, should be enough for you to determine answers from your own setups / server
 
@learning_curve

"A bit tricky for anybody to give an example taken from your setups / server... ;) but, you could raise a service ticket with Plesk / give them server access & they could advise you further, with regard to your own setups and your own Plesk managed areas of logs / log rotation etc"

Maybe we misunderstood :) I was not asking for an example for my server. I was talking in general. You said:

"Depends on how you have setup your own service plans / domains / templates etc as that could / would make a difference between the two"

So my question was/is ... could you give an example (in general) when there could be a difference. You say depending on setup there could be a difference. So I wanted to know what (in general) could cause such a difference.

"See above"

Still not clear. One setting says 1 month, the other says 6 months. Which setting counts? Yes I could test, but I was hoping someone (Plesk staff) could just tell me the answer. If I would need to test everything first, then there would be no need to ask any question at all, would there? ;)

"The 1st repsonse above, plus Post #5, especially the last section, again, should be enough for you to determine answers from your own setups / server"

Apparently not. Just a simple question: which logs does it concern and which setting overrules the other? These are simple and clear questions in my opinion. Unfortunately I did not yet receive a clear answer. Yes I could go and test things, but that is not the purpose of my question.
 
@Pleskie Our setup / server / choices etc will not be the same as your own. We're Plesk users, just like yourself, but, we don't have any technical issues, with logs / log rotation. That's with either; all of the Plesk controlled logs (and their settings, that we have chosen) or, with all of the other non-Plesk controlled logs, where we've added our own customizations to their logs and log rotation settings. Hence all of our previous posts in this thread.

We're not Plesk and don't represent Plesk. So any general questions re: logs / log rotation / setup / changes etc, you'll need to ask Plesk directly, yourself, if you cannot find the answers you need, within all of the existing, large amounts of Plesk documentation / Support articles. You've stated that you want all answers in advance, but, that you don't want to test anything yourself, yet, some of those answers will depend on your own current setup / server / choices. As mentioned, if you require specific advice / detailed analysis, that includes taking into account your own choices of setup / server / choices, for Plesk controlled logs and log rotation, you'll need to raise a Plesk service ticket & give them accesss, in order for them to fully assist. That's probably the easiest & quickest solution for you.
 
So my question was/is ... could you give an example (in general) when there could be a difference. You say depending on setup there could be a difference. So I wanted to know what (in general) could cause such a difference.
I don't have much to add. I'll note this.

Your server could be set to 1 month. Your service plan might be set to 3 months. If these two diverge, I'm not actually sure which one takes priority. But one does. It would make sense if the service plan took priority. In this case, you'd have different log retention for different plans.
 
Going back to this:
The setting in Question 1 and 3 is the exact same one. So weird
We said:
Not always... Depends on how you have setup your own service plans / domains / templates etc as that could / would make a difference between the two
But, part of that ^ is explained in a bit more detail here:
Your server could be set to 1 month. Your service plan might be set to 3 months. If these two diverge, I'm not actually sure which one takes priority. But one does. It would make sense if the service plan took priority. In this case, you'd have different log retention for different plans.
This ^ makes Post #11 perhaps even more valid now - FWIW
 
@learning_curve

Again ... I'm not talking about my server settings or your server settings. I am talking in general. For example: we install Plesk on a new server. On the general page the setting is set to keep web traffic for 1 month. In the service plan the setting is set to keep web traffic for 6 months. Which setting is being respected?

@john0001 said he would expect the setting of the service plan to take priority. That makes sense. However documentation states about the daily log rotation option "The server-wide log rotation settings overwrite those for particular domains and service plans (existing and future ones).". I am not fully sure if these setting would overwrite web traffic as well. Documentation states that daily log rotation affects:

  • /var/log/nginx/*
  • /var/log/maillog
  • /var/www/vhosts/*/logs/*
  • /var/log/plesk/xferlog.processed
  • /var/log/fail2ban.log
  • /var/log/modsec_audit.log
Maybe this one "/var/www/vhosts/*/logs/*" will affect traffic (access) logs. I am not sure, but if it does, then it would mean the service plan settings are being overwritten. But again, I am not sure about this.
 
...I am talking in general.
The 2nd paragraph of post #11 already gave you a simple answer for all 'general' related questions.
Maybe you have your own, very good reasons for not wanting to contact Plesk directly, but that's still a useable & valid option for you.
....For example: we install Plesk on a new server....
The rest of the post, is dealing with hypotheticial situations / scenarios and is not your actual own current server / setups / choices etc c/w real data & info.
You've previously stated that you do not wish to test anything at all, yourself. You only wish to ask questions (in advance of any making changes yourself).
Both of those ^ are valid reasons why the first answer above is a straightforward option for you & it's still your own choice if / why / when you take that option.
 
@learning_curve

I'm just talking about a clean Plesk install. So you install Plesk and set one setting to 1 month and the other to 6 months. Which setting is being respected. It has nothing to do with your or my settings. It's just a general question. I expected someone here could give me the answer, but apparantly not.
 
Back
Top