creaet session only where needed and add logger to output stream

This commit does the following:
1. fix to only create a single session if the scp plugin is configured to copy
   only the console log and no other files.
2. Give createOutStream a logger.