Improve tracing and logging

Change-Id: Ia00bca964c116e6cdfbdc5cc2900826bbe680e16