Function setLogger

Sets the logger to be used. It's not recommended to set a logger in production environments