/etc/apache2/logs/domlogs/%user% creation

sparek-3

Well-Known Member
Aug 10, 2002
2,148
265
388
cPanel Access Level
Root Administrator
What process/script/command creations the linkage of domlogs for an account under the /etc/apache2/logs/domlogs/%user% directory?

When a new account is created domlogs are immediately created for the domain - /etc/apache2/logs/domlogs/%domain% /etc/apache2/logs/domlogs/%domain%-ssl - and then after some time, magically those domlogs get a link inside /etc/apache2/logs/domlogs/%user%. The links in /etc/apache2/logs/domlogs/%user% are not created with account creation.

Is it possible to force those links to be created after account creation? Is there a specific script I can run that will create those links?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
@sparek-3

I don't have full information on the process but the splitlogs binary is what fulfills this portion. The docs on it are here: The splitlogs Binary | cPanel & WHM Documentation

I don't think you can use it without piped logging enabled though which I believe would defeat the purpose.
 

sparek-3

Well-Known Member
Aug 10, 2002
2,148
265
388
cPanel Access Level
Root Administrator
I don't know if that is it.

Because I don't use piped logging and this activity happens. But thus far I've only been able to conclude that it happens by magic.

When I transfer or restore an account onto a server, the necessary /etc/apache2/logs/domlogs/%domain% /etc/apache2/logs/domlogs/%domain%-ssl files are created. The /etc/apache2/logs/domlogs/%user%/%domain% /etc/apache2/logs/domlogs/%user%/%domain%-ssl are not immediately created. But then after a period of time (which appears to be random... thus the magic part) the /etc/apache2/logs/domlogs/%user%/%domain% /etc/apache2/logs/domlogs/%user%/%domain%-ssl appear. The /etc/apache2/logs/domlogs/%user%/%domain% appears to be a hard link to it's /etc/apache2/logs/domlogs/%domain% counterpart.

It's not a huge deal. There are times when I migrate an account and I'd like to see if web hits are happening on the new server and that's easier to do with the username variant - tail -f /etc/apache2/logs/domlogs/%user%/*. That and the mystery of solving the magic.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Hey @sparek-3


Sorry about the delay in response to this, I've been discussing this with someone who is pretty familiar with the configuration/piped logging in general and he indicated that running the runstatsonce script does this. So if you want to manually run this:

Code:
/usr/local/cpanel/scripts/runstatsonce $USERNAME
He tested with and without piped logging enabled and found that it creates them in both instances.