add logging to renderCelementsDocumentWithLayout and overwrite doc
variable in vcontext.