Added method in AgentLogger to log stack trace and switched Agent to
using the new logging functionality