CacheLib icon indicating copy to clipboard operation
CacheLib copied to clipboard

How to configure folly for logging CacheLib

Open vaavaav opened this issue 1 year ago • 0 comments

So, I noticed CacheLib uses folly to log many parts of the workflow (XLOG, XLOGN, XLOG_IF, ...). In examples/simple_cache, I'm trying to configure folly so that logging goes to a file like so:

int main(int argc, char** argv) {
  folly::init(&argc, &argv);
  folly::LoggerDB::get().registerHandlerFactory(
      std::make_unique<folly::FileHandlerFactory>());
  folly::initLogging("INFO;default=file:path=cachelib.log");

The file gets created, but it's always empty. I'm guessing that this folly configuration is not propagated to CacheLib or logging is disabled inside CacheLib.

I have tried many variations and followed some of the explanations/examples from the folly repo, but nothing works.

vaavaav avatar Jul 25 '24 11:07 vaavaav