Functionality internal to Logdoc. Should never be used directly.