CodeIgniter Forums
Logging from outside CI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Logging from outside CI (/showthread.php?tid=14175)



Logging from outside CI - El Forum - 12-21-2008

[eluser]jalalski[/eluser]
I have a callback page that is called from outside the site, yet I need to make use of CI facilities.
So, I'm loading the Common, Config, Language and Log classes and instantiating the basic system, but calls to log_message are silently failing to write anything.
Simlarly:
Code:
$LOG =& load_class("Log");
$LOG->write_message(...)
doesn't have any effect.

Any clues?


Logging from outside CI - El Forum - 12-21-2008

[eluser]Jamie Rumbelow[/eluser]
Try calling get_instance() and access the CI masterclass.


Logging from outside CI - El Forum - 12-21-2008

[eluser]jalalski[/eluser]
Tried that, no luck Undecided

It's no big deal, I can fopen, fwrite and fclose. Just the log_message is pretty cool way to do it.