Fixes to logging and deprecated api

    * Add stacktrace to error log.

    * Replace call to deprecated temporary file
    method.