Added log collection code