absent-sapphire•13mo ago
How can I override the default logs of Crawlee?
Hello I wonder how to override the default logs of crawler, this is how it looks:
This logs came from basic-crawle library: (https://github.com/apify/crawlee/blob/3ffcf56d744ac527ed8d883be3b1a62356a5930c/packages/basic-crawler/src/internals/basic-crawler.ts#L891)
I am using Playwright, and thats how I mange to override default logs with my custom like that:
and thats how I use them:
GitHub
crawlee/packages/basic-crawler/src/internals/basic-crawler.ts at 3f...
Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, an...

6 Replies
Post created!
This post has been synced with the Apify community site and will be indexed by search engines
absent-sapphireOP•13mo ago
Solution:
The solution is to add
internal
method to your proxy class, here is full code for proxy winston
-> crawlee
log
I manage to override some logs, but still struggling to make statistic work as wellabsent-sapphireOP•13mo ago
I manage to do this by overriding
child
method and passing data
object to my Winston
Logger, but what concern me are those 3 repeating logs
I don't have anything like that in my code, its from library:
Attempting to run a task.
: https://github.com/apify/crawlee/blob/c69a34a616feda0824c88f9ec18871bff0b212c0/packages/core/src/autoscaling/autoscaled_pool.ts#L473
Checking for ready tasks.
: https://github.com/apify/crawlee/blob/c69a34a616feda0824c88f9ec18871bff0b212c0/packages/core/src/autoscaling/autoscaled_pool.ts#L504
Task will not run. No tasks are ready.
: https://github.com/apify/crawlee/blob/c69a34a616feda0824c88f9ec18871bff0b212c0/packages/core/src/autoscaling/autoscaled_pool.ts#L519
@Marco hi I see you are a developer at Apify, maybe you know answer to my questionGitHub
crawlee/packages/core/src/autoscaling/autoscaled_pool.ts at c69a34a...
Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, an...
absent-sapphireOP•13mo ago
Thats how it looks

absent-sapphireOP•13mo ago
okey fixed, small issue with switch and handling
PERF
log level, I was treating them as INFO, and I should treat them as DEBUG or mock logic to ignore those strings:
@Wojciech just advanced to level 3! Thanks for your contributions! 🎉