Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Log files being created every couple of minutes

    HELP Please

    My customers site is producing many many log files, we deleted 1.3 million of them this morning that were taking up 17GB of space.

    The content is [16-Feb-2019 13:46:22 Europe/London] PHP Fatal error: Call to a member function RecordCount() on a non-object in /home/*******/public_html/***/includes/templates/bana/blocks/banner/view.php on line 4

    that file is

    <div class="block banner">
    <?php
    $banner = zen_banner_exists('dynamic', $data['banner-group']);
    if ($banner->RecordCount() > 0) :
    ?>
    <?= zen_display_banner('dynamic', $data['banner-group']) ?>
    <?php else: ?>
    <p class="bg-danger">Add a banner to '<?=$data['banner-group']?>' group</p>
    <?php endif; ?>
    </div>

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: Log files being created every couple of minutes

    The function zen_banner_exists returns either (bool)false if the specified banner doesn't exist or an array of banner-related fields pulled from the database.

    Try changing your code-block as follows:
    Code:
    <div class="block banner">
    <?php
    $banner = zen_banner_exists('dynamic', $data['banner-group']);
    if ($banner !== false) :
    ?>
    <?= zen_display_banner('dynamic', $data['banner-group']) ?>
    <?php else: ?>
    <p class="bg-danger">Add a banner to '<?=$data['banner-group']?>' group</p>
    <?php endif; ?>
    </div>
    Last edited by lat9; 16 Feb 2019 at 03:27 PM. Reason: Missing parentheses

  3. #3
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Log files being created every couple of minutes

    Ok ty. will monitor it for a while. If that does fix it I wonder why it suddenly started producing the error logs
    Last edited by Congerman; 16 Feb 2019 at 03:49 PM.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: Log files being created every couple of minutes

    Did the site's PHP version change recently?

  5. #5
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Log files being created every couple of minutes

    not that I am aware of.

    Thank you for your code change, No new error logs have been produced in the last 40 mins. I guess the code does not get to the root cause of the error but just stops it from being reported?

    doing the math on the number of files, if they were being created every minute then this has been going on for 2 1/2 years.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: Log files being created every couple of minutes

    Quote Originally Posted by Congerman View Post
    not that I am aware of.

    Thank you for your code change, No new error logs have been produced in the last 40 mins. I guess the code does not get to the root cause of the error but just stops it from being reported?

    doing the math on the number of files, if they were being created every minute then this has been going on for 2 1/2 years.
    I misspoke in my original response; zen_banner_exists returns either (bool)false if the banner doesn't exist or the return from the SQL query (a query_factory object) otherwise.

    My suspicion is that a banner in the store expired, so that (bool)false was being returned, resulting in the PHP warning.
    Last edited by lat9; 16 Feb 2019 at 05:31 PM. Reason: Removed 'recently, since the issue's been around for 2.5-ish years

  7. #7
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Log files being created every couple of minutes

    Thank you. I will need to track down the culprit banner.

  8. #8
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Log files being created every couple of minutes

    Having looked in admin, banners I am not seeing any dates associated with the banners. How do I find the expired one?

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: Log files being created every couple of minutes

    I'm guessing (since I'm not a big banner user) that the Status column shown in Tools->Banner Manager will show a red icon if the banner is disabled, either manually or due to expiration.

  10. #10
    Join Date
    Oct 2008
    Posts
    378
    Plugin Contributions
    0

    Default Re: Log files being created every couple of minutes

    Yup, I thought that but they all green. looked at each banner and none of them have an expiry date. Hey ho, one of life's little mysteries.

    Thank you for your help

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 Weird sql files being created in cache folder every second?
    By travbacon in forum General Questions
    Replies: 11
    Last Post: 7 Oct 2016, 08:21 PM
  2. Replies: 5
    Last Post: 12 Sep 2013, 04:23 PM
  3. Increase log-in time past 24 minutes?
    By joejoejoe in forum Managing Customers and Orders
    Replies: 2
    Last Post: 17 Nov 2011, 02:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR