Drupal - How to generate a stack trace upon errors
You can use the Devel module, and select one of the "Krumo Backtrace" options it provides in its configuration page at admin/config/development/devel.
Make sure to visit admin/config/development/logging and select "Errors and Warnings" or "All Messages". If you have the Syslog module, or any other logging module enabled, you may need to disable it and enable the Dblog module.
in your drupal system in modules section under core modules their is syslog module to store log on the disk. hope it help what your looking for.