OPNsense Forum

English Forums => Development and Code Review => Topic started by: ndejong on July 30, 2017, 02:57:20 pm

Title: Logging and debugging in development?
Post by: ndejong on July 30, 2017, 02:57:20 pm
I'm working on putting together an OPNsense plugin at the moment and have run into what would otherwise seem like a trivial problem to resolve if I could observe what the OPNsense web-app framework is doing under the covers.

I've tried switching debug=true in opnsense/mvc/app/config/config.php but I can't really see where the debug or logging messages are going or where to find them.

Could anyone point me in the right direction?
Title: Re: Logging and debugging in development?
Post by: franco on July 31, 2017, 08:49:46 am
Hi there,

I have to admit I never used that debug setting...

MVC debugging can be a bit tricky as there are multiple layers that can fail and there is no single log that will let you see it all.

Normally, /tmp/PHP_errors.log is the one to look for warnings / errors from the code itself.

A browser debug console is also helpful to inspect the API requests from the page.

Configd backend requests are logged in the system log (System: Log File), also from the console:

# clog /var/log/system.log

What specific error are you looking at? More details will certainly help to help more.


Cheers,
Franco