Dan Lester

Active Member
Dec 7, 2017
40
1
8
Austin TX
cPanel Access Level
Website Owner
Yes, the raw logs are monthly. That's better than nothing. I don't have a Configure Logs option. What's that? Looks like it might be useful.

But yes, a VPS with root access would be the way to go. That's pricier. My present shared server implementatino is adequate, but it would just be nice to have this kind of log access.
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
466
113
UK
cPanel Access Level
Root Administrator
In your
cPanel > METRICS > Raw Access
.......you should have options to Configure Logs

log1.jpeg

If you are not seeing this, you might try reaching out to your host to switch on the options for you
 
Last edited:

Dan Lester

Active Member
Dec 7, 2017
40
1
8
Austin TX
cPanel Access Level
Website Owner
Oh, I see what you mean. Yes, I default to archiving daily logs. But that just writes over that archive every day.. It doesn't preserve daily logs. And while I now preserve my monthly logs, as I say, it would be nice to examine a weeks worth at a time (starting, say, on Sunday), rather than an archive that starts on the first of the month.

Having said that, about the monthly logs, I see it offers me the access-logs from the first of the month up to, er, yesterday. So if I want to examine previous logs for the whole month, I really have to add to that file the daily log. That's not hard, but just a PIA.

One other thing I miss with my shared server that I had when I managed Apache on a private server is real-time logging. If I look at my access log now, it shows me accesses up to maybe an hour ago. Yes, a VPS would fix that!

I run a large telecon meeting once a week where we discuss downloadable documents. It would be nice to have a real-time log that told me how many downloads were done before my telecon starts. But I don't get that anymore.
 

Dan Lester

Active Member
Dec 7, 2017
40
1
8
Austin TX
cPanel Access Level
Website Owner
Speaking of the monthly access logs files, those files in ~/logs are owned by the user. Not by root! Bizarre. So I can play with those monthly log files in cron all I want, but cron can't touch those daily log files.

In my mind, this is a major OS design error. What were they thinking?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
Hello Dan,

I believe the difference you notice is because the daily log files do not actually exist under the account, but are symbolic links pointing to the corresponding log files in the /etc/apache2/logs/domlogs/ directory. Also, here's some additional information that it looks like you are already aware of, but might help anyone else seeing this thread for the first time:

1. Here's some general information about the options available to your web hosting provider under the "Stats and Logs" tab in "WHM >> Tweak Settings". It's important to understand these options, as their use may affect how you can access the access logs associated with your account:

Delete each domain’s access logs after statistics are gathered - This setting deletes all access logs after each statistics generation (by default it happens every 24 hours).

Archive logs in the user's home directory at the end of each stats run unless configured by the user. - This option will only be used if the user does not configure their log archiving preferences in cPanel.

Remove the previous month's archived logs from the user's home directory at the end of each month unless configured by the user. -
This option will only be used if the user does not configure their log archiving preferences in cPanel.

2. In cPanel, under the "Raw Access" option, the following settings are available:

Archive logs in your home directory at the end of each stats run every 24 hours.
Remove the previous month’s archived logs from your home directory at the end of each month.

On most servers, you can simply enable "Archive logs in your home directory at the end of each stats run every 24 hours." via the "Raw Access" option in cPanel, and you will then have access to your raw access logs.

Thank you.
 

Dan Lester

Active Member
Dec 7, 2017
40
1
8
Austin TX
cPanel Access Level
Website Owner
Thank you for your assistance in this, Michael.

When I "archive logs in your home directory", I believe it just writes one log file every day, and writes over it the next day. What I was trying to do was preserve those daily files, if just by concatenating them into one file in cron. But I guess that monthly files will have to do, unless I want to do a manual job every evening at 11:59pm.

I do NOT have WHM access, unfortunately. Sounds like there might be tools in WHM that would be helpful.

Perhaps oddly I do not have /etc/apache2. Not sure where the Apache stuff is kept. I can't get into / to look for it.

I appreciate the advice here at cPanel forums. I'm new here, but you guys are very responsive.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
Perhaps oddly I do not have /etc/apache2. Not sure where the Apache stuff is kept. I can't get into / to look for it.
You won't be able to access that directory without root access to the system.

Thank you.
 

Dan Lester

Active Member
Dec 7, 2017
40
1
8
Austin TX
cPanel Access Level
Website Owner
OK, this turned out to be not that hard. One just has to have cron execute a script that addresses the root files. As in, cron needs to do

"bash archivejob"

where basharchivejob is a file containing

"cat /home1/me/access-logs/mylog >> archivehold"

So you end up with a file archivehold that gets added to every day with the daily log. At the end of a week, you have a weeks worth of archive. I still think it is kinda perverse that I manually have access to root-owned files while cron does not.