Added logging, switched to use 'once' instead of 'on' to allow it to work in a multi-request environment