Handle logger in main factory.