CA
Crawlee & Apify•3y ago
eastern-cyan

How to get the logs in json?

I run crawlee with a kubernetes cron and I have an agent that gets the output and puts it into an Elasticsearch. I would like to have a JSON output that is not prefixed by main INFO PlaywrightCrawler: How can I do this ?
2 Replies
MEE6
MEE6•3y ago
@Guillaume C just advanced to level 1! Thanks for your contributions! 🎉
adverse-sapphire
adverse-sapphire•3y ago
There is an automatic log that you can monkeypatch on the crawler object but I don't know exactly where now https://github.com/apify/crawlee/blob/master/packages/playwright-crawler/src/internals/playwright-crawler.ts Or you can disable logs completely by the log.setLevel
GitHub
crawlee/playwright-crawler.ts at master · apify/crawlee
Crawlee—A web scraping and browser automation library for Node.js that helps you build reliable crawlers. Fast. - crawlee/playwright-crawler.ts at master · apify/crawlee

Did you find this page helpful?