Add Trace Logging
Fixes #1639