fix trace logging
add trace logging test