This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Seperate PHP error logs per domain,
#1
Seperate PHP error logs per domain,
Hello,

At present my server does not display errors but logs them to the 
error_log = "C:/zpanel/logs/php/php_errors.log" which i believe is default,
But all domain errors go onto the same log,

I wish to separate them per domain,
I tried to do via .htaccess but it throws 500 errors and kills the site,

It does work if i manually add a line into the httpd-vhosts.conf
php_value error_log "C:/zpanel/logs/php/<MYDOMAIN>_php.error.log"

But ofcorse this will be overwritten,

My question, is there a better way, or is it possible to have sentora write this line to conf when it generates the vhosts conf?


All files are fine to stay in the same directory, I am the only person who uses my server for multiple domains, and no one else,

Many thanks for your help in advance,

Cathelest.
Reply
Thanks given by:
#2
RE: Seperate PHP error logs per domain,
The panel does create individual log files for each domain. If it is not, then there is an issue with the way you have setup/installed the panel.

They should be in c:/zpanel/logs/domains/

this is also where the bandwidth and access logs for each domain are.
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:
#3
RE: Seperate PHP error logs per domain,
(07-21-2016, 04:46 AM)TGates Wrote: The panel does create individual log files for each domain. If it is not, then there is an issue with the way you have setup/installed the panel.

They should be in c:/zpanel/logs/domains/

this is also where the bandwidth and access logs for each domain are.

It does create a error, access and bandwith log for each domain, but not a php errors?

The error log is only showing me apache errors, as in file/script not found etc,
Reply
Thanks given by:
#4
RE: Seperate PHP error logs per domain,
It should be showing them. Do you have php error reporting on?
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:
#5
RE: Seperate PHP error logs per domain,
(07-22-2016, 12:29 AM)TGates Wrote: It should be showing them. Do you have php error reporting on?

Thanks for your help, my php.ini (just grabbed the bits which i beleive relate to error messages)

error_reporting = E_ALL & ~E_DEPRECATED
display_errors = Off
display_startup_errors = O
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = Off
error_log = "C:/zpanel/logs/php/php_errors.log"

Thanks again for your support, I really appreciate it,
Reply
Thanks given by:
#6
RE: Seperate PHP error logs per domain,
It should be working with that setup. Maybe you don't have any php errors? lol What is it that you are working on that you are not seeing the errors?
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:
#7
RE: Seperate PHP error logs per domain,
Go to the terminal and edit your php.ini file (Uncomment the error_log directive)

   

Restart your apache service.

After this, you will get the error log in the folder where the script resides.
Please note that if the error is in a script included from some other folder, the error log will be generated in the folder which has the main script.
Reply
Thanks given by:
#8
RE: Seperate PHP error logs per domain,
You can create php error logs for each domain in two ways:
1. .htaccess method

Code:
# enable PHP error logging
php_flag  log_errors on
php_value error_log  C:\Sentora\logs\php\php_error_your_domain_name.log

Add this into your .htaccess file

2.Virtual host method

=> open OnDaemonRun.hook.php file in C:\Sentora\panel\modules\apache_admin\hooks
 
find    ## Regular Domain or Subdomain ## part

Add this:


Code:
$line .= '    php_admin_value log_errors on' . fs_filehandler::NewLine();
$line .= '    php_admin_value error_log "' . ctrl_options::GetSystemOption( 'log_dir' ) . "domains/" . $vhostuser[ 'username' ] . "/" . $rowvhost[ 'vh_name_vc' ] . '-phperror.log" ' . fs_filehandler::NewLine();



after ErrorLog  and Customlog part.

Code:
$line .= ' ErrorLog "' . ctrl_options::GetSystemOption( 'log_dir' ) . "domains/" . $vhostuser[ 'username' ] . "/" . $rowvhost[ 'vh_name_vc' ] . '-error.log" ' . fs_filehandler::NewLine();
$line .= ' CustomLog "' . ctrl_options::GetSystemOption( 'log_dir' ) . "domains/" . $vhostuser[ 'username' ] . "/" . $rowvhost[ 'vh_name_vc' ] . '-access.log" ' . ctrl_options::GetSystemOption( 'access_log_format' ) . fs_filehandler::NewLine();


You can check php logs of domains in sentora -> logs -> domains folder with this modification.
Reply
Thanks given by:


Possibly Related Threads...
Thread Author Replies Views Last Post
My domain always redirect to control panel login page khir 3 8 125 05-25-2020, 12:04 AM
Last Post: muratkaragoz
AWServer with ZPanelX 2.2 - Domain Connections Refused - language files - n more odinwynd 20 28 552 05-28-2017, 05:05 AM
Last Post: TGates
Error 500 Issues! chiefody 3 4 712 03-04-2017, 06:42 AM
Last Post: cathelest

Forum Jump:


Users browsing this thread: 1 Guest(s)