Nice script as ever, saved me days of coding. Can you help with this error
“Fatal: Call to a member function Log() on a non-object”
when I write
if ($login_result1==1) { $LogBase->Log(‘Could not connect to FTP 1 ’); }
any ideas?
Nice script as ever, saved me days of coding. Can you help with this error
“Fatal: Call to a member function Log() on a non-object”
when I write
if ($login_result1==1) { $LogBase->Log(‘Could not connect to FTP 1 ’); }
any ideas?
Thanks for your reply SiteBase, I have not given you enough detail as the error log and the screen error function is working OK and I have the$LogBase = new LogBase(); included.
the beginning of the scirip has the following:
include(“imageprocessor.php”); include(“LogBase.php”); // // Set up error log options // $LogBase = new LogBase(); // create a new instance of log // Types to log $LogBase->enable_error(true, E_PARSE, E_WARNING, E_ERROR); $LogBase->enable_fatal(); $LogBase->enable_exception(); // Log methods $LogBase->enable_method_file(true, array(‘path’ => dirname( FILE ).’/error_log/’)); $LogBase->enable_method_print(); // $LogBase->enable_method_mail(true, array(‘email’ => ‘myemail@website.be’)); // // Global scope VARS // .. ..
Then it lists the various subrountine functions including
function ftp_send_image1($chn1) { .. pre amble .. $conn_id1 = ftp_connect(FTP_SERVER1); $login_result1 = ftp_login($conn_id1, $ftp_user_name1, $ftp_user_pass1);
if ($login_result1<>1) // could not connect or login to ftp { $LogBase->Log(‘Could not connect to FTP 1 ’); // log the problem ftp_close($conn_id1); // close the FTP stream return $login_result1; } $upload1 = ftp_put($conn_id1, $destination_file1, $imagefile_name1, FTP _BINARY); .. .. etc
and then the main calling script.
$error32=ftp_send_image1(‘1’); .. etc
When I run this I get the
“Fatal: Call to a member function Log() on a non-object”
Can you help please?
Cheers K
if (!$login_result1) // could not connect or login to ftp
{
$LogBase->log(‘Could not connect to FTP 1 ’) ; // log the problem
ftp_close($conn_id1); // close the FTP stream
return $login_result1;
}
and it gave the error
Fatal: Call to a member function log() on a non-object (/var/www/imageprocessing/push_ftp.php:83)
Hope you can help, everything else works fine, it would just be nice to ba able to log errors with the log() command.
Cheers
Geo
Hi $handler->SetServer(“http://www.mywebsite.be/logserver/server.php”); $handler->SetServerPsk(“the same string as $logserver_psk”);
How do I use that function? When I used that function SetServer so cache folder do not create file **.log Looks like server.php do not run Could you fix it for me ?? Thank you
Can you please add the server logger back in. Was a really great feature. (not sure why you removed it anyways.).
Thanks
Can I send logged error to an email? Say I wish to receive an email whenever fatal error or database server connection goes down. Does your script work this way too?
As metioned in the description: yes this is possible:
$LogBase->enable_method_mail(true, array('email' => 'myemail@mysite.com'));
also would like server logger in next update
I’d like to use the email reporting facility with this script. Does it have the following features?
I’m basically looking for configuration options for the email.
I’d be happy to code this functionality myself, is the code readily extended (e.g. did you use object oriented practices?).
Thank you.
COPYRIGHT © 2012 ENVATO| TERMS OF USAGE| SUPPORT/HELP| ICONS BY TANGO + WEFUNCTION + FAMFAMFAM
Adobe®, Flash®, Flex®, Fireworks®, Photoshop®, Illustrator®, InDesign® and After Effects® are registered trademarks of Adobe Systems Incorporated.
111 Purchases
28 Comments