How can I get a full stack trace in my custom plugin log? I'm using MyPlugin::log to separate the errors for my plugin. However, I'm only able to log a simple message using this technique.

Is it possible to have that output the full stack trace?

Here's what I'm getting (note the general format)...

2015/06/09 20:41:42 [error] [plugin] My example error message.
in /craft/app/etc/plugins/BasePlugin.php (65)
in /craft/plugins/businesslogic/services/BusinessLogicService.php (194)
in /craft/plugins/businesslogic/controllers/BusinessLogic_ActivitiesController.php (47)


But here's what I want (again, note the general format)...

2015/06/09 20:39:25 [error] [exception.CException] exception 'CException' with message 'Craft\BusinessLogic_ActivitiesController and its behaviors do not have a method or closure named "handleError".' in /craft/app/framework/base/CComponent.php:266
Stack trace:
#0 /craft/plugins/businesslogic/controllers/BusinessLogic_ActivitiesController.php(47): CComponent-&gt;__call('handleError', Array)
#1 /craft/plugins/businesslogic/controllers/BusinessLogic_ActivitiesController.php(47): Craft\BusinessLogic_ActivitiesController-&gt;handleError()
#2 /craft/app/framework/web/actions/CInlineAction.php(49): Craft\BusinessLogic_ActivitiesController-&gt;actionUpdate()


How do I get the #0, #1, #2, etc. to show up?
By default a full stack trace will only be assembled and logged if an exception is thrown (which is what you're looking at in your 2nd example) mainly for performance reasons - cycling through the backtrace and assembling all of that info is a relatively expensive operation.

Standard calls to MyPlugin::log or Craft::log will get a partial backtrace added to each message.  The depth of that is controlled by the YII_TRACE_LEVEL PHP constant, which Craft sets to 3 by default.

If you want to have them log deeper into the trace, set that to a higher number in your public index.php file, just be aware of the performance implications.

There is some discussions of that constant here in the Yii docs: http://www.yiiframework.com/doc/guide/1.1/en/topics.logging#logging-context-information