Forums / General Questions / Log files being created every couple of minutes

Log files being created every couple of minutes

Started by congerman on 16 Feb 2019, 1:55 PM · Views: 2,787

Results 1 to 13 of 13
16 Feb 2019, 1:55 PM
#1
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

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>
16 Feb 2019, 2:27 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,129
Plugin Contributions:
56

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:

<div class="block banner">
<?php
$banner = zen_banner_exists('dynamic', $data['banner-group']);
if ($banner [B]!== false[/B]) :
?>
<?= 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> 
16 Feb 2019, 2:44 PM
#3
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

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

16 Feb 2019, 3:13 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,129
Plugin Contributions:
56

Re: Log files being created every couple of minutes

Did the site's PHP version change recently?

16 Feb 2019, 3:43 PM
#5
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

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.

16 Feb 2019, 4:30 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,129
Plugin Contributions:
56

Re: Log files being created every couple of minutes

Congerman:

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.

16 Feb 2019, 4:34 PM
#7
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: Log files being created every couple of minutes

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

16 Feb 2019, 4:43 PM
#8
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

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?

16 Feb 2019, 4:47 PM
#9
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,129
Plugin Contributions:
56

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.

16 Feb 2019, 4:56 PM
#10
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

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

16 Feb 2019, 5:36 PM
#11
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: Log files being created every couple of minutes

new problem. now I have changed the code I get "add a banner to banner 1 group banner 2 group and banner 3 group as text on the front page no doubt generated by this part of the code block we edited earlier

<?php else: ?>
<p class="bg-danger">Add a banner to '<?=$data['banner-group']?>' group</p>
<?php endif; ?>

Attachment 18339

16 Feb 2019, 6:28 PM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Log files being created every couple of minutes

Not exactly a new problem, but the result of as you said addressing the other issue...

So what do you want there or on any other page? Currently it is either content to be displayed on the home page within banner-1, banner-2, and/or banner-3 or the message that it is desired to add something to the group(s).

It's an if/else statement. Do this or do that...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

17 Feb 2019, 4:22 PM
#13
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: Log files being created every couple of minutes

So the quick way around this was to actually create and populate the banner groups that it was asking for. Annoyingly cannot see where to turn of the requirement to have these banners. Hey ho, at least the log files have stopped being created. Thank You