fix crash with circular objects

If you pass a object with an circular reference, JSON.stringify throw an exception. Use json-stringify-safe to drop circular references from the log.