Split log file
Split log file
Is there any way to have separate log file for each domain?
I mean, I have couple domains and it make very difficult to analyze data
I mean, I have couple domains and it make very difficult to analyze data
Re: Split log file
Have a look here:
viewtopic.php?t=1406
This works fine for me.
Hopefully you can read German
Otherwise I would have to translate it to English.
Oh, No, Please Not!
viewtopic.php?t=1406
This works fine for me.
Hopefully you can read German
Otherwise I would have to translate it to English.
Oh, No, Please Not!
Gruß,
Tobi
-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Tobi
-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Re: Split log file
I wish, but no
thats why I'm in English section, maybe google translate help me
thats why I'm in English section, maybe google translate help me
Re: Split log file
ask if you don't get it translated.
I'll help you
I'll help you
Gruß,
Tobi
-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Tobi
-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Re: Split log file
Well, heavy stuff, understand 50%.
If i use this method, what happens with current data in access.log?
also i found tool "goaccess" you can probably use it to view statistics for each domain from a single file. probably...
If i use this method, what happens with current data in access.log?
also i found tool "goaccess" you can probably use it to view statistics for each domain from a single file. probably...
Re: Split log file
If you unterstood the important 50%, that´s enough
The current logfiles remain unchanged.
It only changes the behaviour of future logfiles.
After the patch is applied and active it will generate separate logfiles for all your domains.
But only the access logfiles. errorlogs etc. are also unchanged.
Gruß,
Tobi
-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Tobi
-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Re: Split log file
If think the simplest way to go is one user = one domain
Devs
This is really not good idea have one access.log for ALL domains
nobody does that now. at least the last 10 years..
Devs
This is really not good idea have one access.log for ALL domains
nobody does that now. at least the last 10 years..
-
- Posts: 579
- Joined: Tue 9. Feb 2016, 16:44
Re: Split log file
Viele Grüße, Christian
Re: Split log file
My English has never been better
Gruß,
Tobi
-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Tobi
-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
-
- Posts: 579
- Joined: Tue 9. Feb 2016, 16:44
Re: Split log file
Viele Grüße, Christian
Re: Split log file
I used this translator and here is the awesome result:
------------------------------------------------------------------
I have had my own solution for generating domain-specific log files for over a year now.
All you need is a root cronjob, a small adjustment to "/etc/logrotate.d/" and my PHP script.
First open the script locally (best with Notepad++ or another UTF-8 / UNIX compliant editor) and adjust lines 3 to 5 at the beginning of the script.
$vhost_dir ==> path to the Keyhelp V-Hosts files, doesn't really need to be adjusted
$backup_dir ==> the directory must exist. This is where backup files of the original V-Hosts files are stored. No slash at the end!
$logfile ==> the changes are logged in this file. It can also be in the webroot of another user (admin).
Now store the file on the server (in my case /root/CRONJOBS/) and make it executable (chmod 755).
Change the file extension to ".php" and then set up a cronjob as root.
For me, the cronjob runs once an hour.
Next, an adjustment in the log file rotation is necessary.
Details can be found here: viewtopic.php?p=5041#p5041
Well, and that's it.
How does the script work?
=======================
When called, the script first determines when it was last run.
Then it scans the $vhost_dir folder for new or changed V-Host files.
If one is found, the line "CustomLog" is adjusted.
"/home/users/username/access.log" becomes "/home/users/username/domain.tld.access.log".
All subdomains are written to the domain-specific log file.
The "ErrorLog" remains unchanged.
The changed V-Host file is saved and Apache is restarted.
No file locking with "chattr -i" is necessary. Keyhelp also works with the adapted version.
====================================================================
I am always open for ideas, opinions, praise, suggestions, criticism and tips .
Just report here in the thread. Then you will be helped.
So and now have fun with the domain-specific logfiles.
LINK TO FILE
Greetings,
Tobi
------------------------------------------------------------------
I have had my own solution for generating domain-specific log files for over a year now.
All you need is a root cronjob, a small adjustment to "/etc/logrotate.d/" and my PHP script.
First open the script locally (best with Notepad++ or another UTF-8 / UNIX compliant editor) and adjust lines 3 to 5 at the beginning of the script.
Code: Select all
$vhost_dir = "/etc/apache2/keyhelp/vhosts";
$backup_dir = "/root/CRONJOBS/vhost_conf_files_backup";
$logfile = "/root/CRONJOBS/vhost_cron_logfile.log";
$backup_dir ==> the directory must exist. This is where backup files of the original V-Hosts files are stored. No slash at the end!
$logfile ==> the changes are logged in this file. It can also be in the webroot of another user (admin).
Now store the file on the server (in my case /root/CRONJOBS/) and make it executable (chmod 755).
Change the file extension to ".php" and then set up a cronjob as root.
For me, the cronjob runs once an hour.
Next, an adjustment in the log file rotation is necessary.
Details can be found here: viewtopic.php?p=5041#p5041
Well, and that's it.
How does the script work?
=======================
When called, the script first determines when it was last run.
Then it scans the $vhost_dir folder for new or changed V-Host files.
If one is found, the line "CustomLog" is adjusted.
"/home/users/username/access.log" becomes "/home/users/username/domain.tld.access.log".
All subdomains are written to the domain-specific log file.
The "ErrorLog" remains unchanged.
The changed V-Host file is saved and Apache is restarted.
No file locking with "chattr -i" is necessary. Keyhelp also works with the adapted version.
====================================================================
I am always open for ideas, opinions, praise, suggestions, criticism and tips .
Just report here in the thread. Then you will be helped.
So and now have fun with the domain-specific logfiles.
LINK TO FILE
Greetings,
Tobi