Author Topic: User Error logs disappeared after recent update  (Read 10143 times)

0 Members and 2 Guests are viewing this topic.

Offline
*
User Error logs disappeared after recent update
« on: February 03, 2020, 04:35:51 PM »
Dear Developers,

Congratulate for the new login window, Iam an PRO user, after recent update error log option is not showing

any where in the user control panel. So please let me know if it was removed or it will be available when any error

happen in php script which Cpanel follow.  So please let me know where is our error log   >:(

If any one know how to move this user error logs to their public directory or error occurring folder same like

Cpanel. OR please consider this request to be added in your next update to move the error logs to user direcotry

by this way user usage quota will also effect and if any one is not caring about error log they will start looking to

it if their quota was full because of error log files.

Offline
*
Re: User Error logs disappeared after recent update
« Reply #1 on: February 03, 2020, 04:53:51 PM »
The error logs stay in the /usr/local/apache/domlogs/*.error.log  ;)

Offline
*****
Re: User Error logs disappeared after recent update
« Reply #2 on: February 03, 2020, 05:03:00 PM »
yes all access and error logs are in /usr/local/apache/domlogs/ sorted by individual domain name.

Offline
*
Re: User Error logs disappeared after recent update
« Reply #3 on: February 04, 2020, 04:35:46 PM »
yes all access and error logs are in /usr/local/apache/domlogs/ sorted by individual domain name.

If the error logs are not accessible by the user in their control panel what was the use to staying it there ..?

Error logs are very important for users, if they have sort of issues in their script how they can access it if it was

not view able from their control panel ? Did you think each time the server admin or support have time to share

the error logs with them ..?

Offline
*
Re: User Error logs disappeared after recent update
« Reply #4 on: February 04, 2020, 04:37:21 PM »
The error logs stay in the /usr/local/apache/domlogs/*.error.log  ;)

If it can't be accessible or view able by the hosted user what is the use of it. Before reply think twise.

It was an important thing which each hosted user needed it.

Offline
*****
Re: User Error logs disappeared after recent update
« Reply #5 on: February 04, 2020, 07:49:41 PM »
user panel error log module is in developement

Offline
****
Re: User Error logs disappeared after recent update
« Reply #6 on: February 05, 2020, 01:24:50 AM »
Seriously Devs.  It's not that hard if you would be willing to expand basedir
Code: [Select]
sed -i "s@fastcgi_param   PHP_ADMIN_VALUE \"open_basedir =/home@fastcgi_param   PHP_ADMIN_VALUE \"open_basedir =/usr/local/apache/domlogs/:/home@g" /root/cwpsrv/conf.d/users/*.confcwpsrv -s reload
Code: [Select]
cp -R /usr/local/cwpsrv/var/services/users/cwp_theme/origional /usr/local/cwpsrv/var/services/users/cwp_theme/modified/// PHP Section  /usr/local/cwpsrv/var/services/user_files/modules/php_error.php
Code: [Select]
<?php
if (isset($_GET["loadfile"])) {
if (
file_exists("/usr/local/apache/domlogs/{$_GET["loadfile"]}.error.log")) {
        echo 
$content file_get_contents("/usr/local/apache/domlogs/{$_GET["loadfile"]}.error.log");
} else {
        echo 
"No File Found";
};
exit;
}
//  Replace this with built in code to populate domains and subdomains //
//use API to get list of users
$mod["returl"] = $_SERVER['REQUEST_URI'];

$data = array("key" => "(SET YOUR API KEY HERE)","action"=>'list',"user"=>$_SESSION ['username']);
$url "https://{$_SERVER['SERVER_NAME']}:2304/v1/accountdetail";
$ch curl_init();
curl_setopt($chCURLOPT_URL$url);
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
curl_setopt($chCURLOPT_CUSTOMREQUEST"POST");
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
curl_setopt ($chCURLOPT_POSTFIELDShttp_build_query($data));
curl_setopt ($chCURLOPT_POST1);
$response curl_exec($ch);
curl_close($ch);
$response json_decode($response);
$domains = array();
$mod['select'] = array();
foreach (
$response->result->domains as $key) {
           
$domains[] = trim($key->domain);
       }
foreach (
$response->result->subdomins as $key) {
        
$domains[] = trim($key->subdomain ."."$key->domain);
}
foreach (
$domains as $domain) {
        
$mod['select'][] = $domain;
}
if (
file_exists("/usr/local/apache/domlogs/{$domains[0]}.error.log")) {

        
$mod['file'] = file_get_contents("/usr/local/apache/domlogs/{$domains[0]}.error.log");
} else {
        
$mod['file'] =  "No File Found";
};

?>

HTML  /usr/local/cwpsrv/var/services/users/cwp_theme/modified/mod_php_error.html   <<< YOu might want to copy origional to modified so it doesn't go bye bye
Code: [Select]
<div class="row">
    <div class="col-lg-12">
        <h1>Error Log</h1>
    </div>
        <div>
         /usr/local/apache/domlogs/
<form action="{{mod.returl}}" action="get"><select id="loadfile">

{% for option in mod.select %}
   <option>{{ option }}</option>
{% endfor %}
</select><noscript><input type="submit" value="Change"></noscript></form>
<textarea id="logfile" readonly style="width:800px; height:400px">{{mod.file}}</textarea>
        </div>
</div>
javascript   /usr/local/cwpsrv/var/services/users/cwp_theme/modified/js/modules/php_error.js.twig
Code: [Select]
(function($){
$(document).ready(function() {
        $("#loadfile").change(function() {
                $.get( "{{mod.returl}}", { loadfile: $("#loadfile").val() },"text" )
                .done(function( data ) {
                        if (data == "") data = "Congratulations!  No PHP Errors were logged";
                        $("#logfile").text(data);
                });
        });
});
})(jQuery);
INI File   /usr/local/cwpsrv/var/services/users/cwp_lang/en/php_error.ini
Code: [Select]
SOMETHING="Nobody Really Cares"

Edit file /usr/local/cwpsrv/var/services/users/cwp_theme/modified/menu_left.html
find (~ Line 62)
{% if ("statistics" in rmenu )or(swmenu==1) %}
        <li class="search"><a href="?module=statistics">{{langene.GNLABEL51}}</a></li>
        {% endif %}

add after
<li class="search"><a href="?module=php_error">PHP Error Log</a></li>
« Last Edit: February 05, 2020, 01:30:47 AM by rcschaff »
Google Hangouts:  rcschaff82@gmail.com

Offline
****
Re: User Error logs disappeared after recent update
« Reply #7 on: February 05, 2020, 01:44:01 AM »
Additional Note, because the theme changer doesn't work, you need to change /home/(users)/.conf/cwp.ini THEME to modified
Google Hangouts:  rcschaff82@gmail.com

Offline
*
Re: User Error logs disappeared after recent update
« Reply #8 on: February 24, 2020, 04:38:19 PM »
Seriously it was very hard to find when a small error occur while executing an script. In the error log viewer there was was option to check date wise. Currently we are running and in the CWP hosting account it have user, manager and admin directory each folder inside some script have some issues in a day that CRM was using by more than 50 users with different with different privilege. If we check the error log for an single folder issue we can't find it when we give Results lines as 1 or 10 So it was an serious mistake in CWP. If the CWP TEAM can build an Hosting panel like this why this option was possible ? 

Offline
*
Re: User Error logs disappeared after recent update
« Reply #9 on: February 24, 2020, 04:42:03 PM »
Hi, can you tell me if it can done from our end, as the CWP TEAM is looking only for get revenue but they for forgot about if there was feature the user will automatically move to paid version (CWP PRO) Because of the feature they are getting. So if you can explain these this can be added by administrator it will be helpful for other who looking for the same answer.   


Seriously Devs.  It's not that hard if you would be willing to expand basedir
Code: [Select]
sed -i "s@fastcgi_param   PHP_ADMIN_VALUE \"open_basedir =/home@fastcgi_param   PHP_ADMIN_VALUE \"open_basedir =/usr/local/apache/domlogs/:/home@g" /root/cwpsrv/conf.d/users/*.confcwpsrv -s reload
Code: [Select]
cp -R /usr/local/cwpsrv/var/services/users/cwp_theme/origional /usr/local/cwpsrv/var/services/users/cwp_theme/modified/// PHP Section  /usr/local/cwpsrv/var/services/user_files/modules/php_error.php
Code: [Select]
<?php
if (isset($_GET["loadfile"])) {
if (
file_exists("/usr/local/apache/domlogs/{$_GET["loadfile"]}.error.log")) {
        echo 
$content file_get_contents("/usr/local/apache/domlogs/{$_GET["loadfile"]}.error.log");
} else {
        echo 
"No File Found";
};
exit;
}
//  Replace this with built in code to populate domains and subdomains //
//use API to get list of users
$mod["returl"] = $_SERVER['REQUEST_URI'];

$data = array("key" => "(SET YOUR API KEY HERE)","action"=>'list',"user"=>$_SESSION ['username']);
$url "https://{$_SERVER['SERVER_NAME']}:2304/v1/accountdetail";
$ch curl_init();
curl_setopt($chCURLOPT_URL$url);
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
curl_setopt($chCURLOPT_CUSTOMREQUEST"POST");
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
curl_setopt ($chCURLOPT_POSTFIELDShttp_build_query($data));
curl_setopt ($chCURLOPT_POST1);
$response curl_exec($ch);
curl_close($ch);
$response json_decode($response);
$domains = array();
$mod['select'] = array();
foreach (
$response->result->domains as $key) {
           
$domains[] = trim($key->domain);
       }
foreach (
$response->result->subdomins as $key) {
        
$domains[] = trim($key->subdomain ."."$key->domain);
}
foreach (
$domains as $domain) {
        
$mod['select'][] = $domain;
}
if (
file_exists("/usr/local/apache/domlogs/{$domains[0]}.error.log")) {

        
$mod['file'] = file_get_contents("/usr/local/apache/domlogs/{$domains[0]}.error.log");
} else {
        
$mod['file'] =  "No File Found";
};

?>

HTML  /usr/local/cwpsrv/var/services/users/cwp_theme/modified/mod_php_error.html   <<< YOu might want to copy origional to modified so it doesn't go bye bye
Code: [Select]
<div class="row">
    <div class="col-lg-12">
        <h1>Error Log</h1>
    </div>
        <div>
         /usr/local/apache/domlogs/
<form action="{{mod.returl}}" action="get"><select id="loadfile">

{% for option in mod.select %}
   <option>{{ option }}</option>
{% endfor %}
</select><noscript><input type="submit" value="Change"></noscript></form>
<textarea id="logfile" readonly style="width:800px; height:400px">{{mod.file}}</textarea>
        </div>
</div>
javascript   /usr/local/cwpsrv/var/services/users/cwp_theme/modified/js/modules/php_error.js.twig
Code: [Select]
(function($){
$(document).ready(function() {
        $("#loadfile").change(function() {
                $.get( "{{mod.returl}}", { loadfile: $("#loadfile").val() },"text" )
                .done(function( data ) {
                        if (data == "") data = "Congratulations!  No PHP Errors were logged";
                        $("#logfile").text(data);
                });
        });
});
})(jQuery);
INI File   /usr/local/cwpsrv/var/services/users/cwp_lang/en/php_error.ini
Code: [Select]
SOMETHING="Nobody Really Cares"

Edit file /usr/local/cwpsrv/var/services/users/cwp_theme/modified/menu_left.html
find (~ Line 62)
{% if ("statistics" in rmenu )or(swmenu==1) %}
        <li class="search"><a href="?module=statistics">{{langene.GNLABEL51}}</a></li>
        {% endif %}

add after
<li class="search"><a href="?module=php_error">PHP Error Log</a></li>