SImple Logging for Debugging Purposes

Permalink 1 user found helpful
Hi everyone!

Hopefully a simple question: How do I print/echo output to a log file for debugging purposes? I have a Controller method that I'm trying to test and I can't see what is going on. I just want to output an object/string somewhere for testing.

I should add that I'm not a master PHP programmer so maybe there is a generic PHP thing I'm unaware of, but preliminary Googling isn't helping. I also check the Concrete5 API but didn't see any Helpers.

Many thanks in advance!
Cheers,

Alex

alexaalto
 
mesuva replied on at Permalink Reply
mesuva
I haven't tested this myself, but according to the doco -http://www.concrete5.org/documentation/developers/system/logging/...

it is just a matter of doing a call to add something to the log,
Log::addEntry('I wish to log this string.');

then going into the Dashboard->Reports->Logs to view the entries.

I think it might be a case of being simpler than you thought!
alexaalto replied on at Permalink Reply
alexaalto
Excellent - I thought it was easy. Now if I can just figure out why my custom dashboard view is not using the corresponding controller...

Thanks again!