Skip to content

How do I use my own logger class? #2098

Answered by B4nan
harshmaur asked this question in Q&A
Discussion options

You must be logged in to vote

You can provide your own logger in the log option of the crawler, but it needs to conform to the apify logger interface, so you'd have to create your own proxy for it to be able to use winston.

https://github.com/apify/crawlee/blob/master/packages/basic-crawler/src/internals/basic-crawler.ts#L329

Note that there might be more places using the logger, this will help only with the logs produced by the crawler class. We generally don't support other loggers out of box, but its something we were thinking about too.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@harshmaur
Comment options

@wojtekKrol
Comment options

Answer selected by harshmaur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants