How to collect Chrome extension logs to a file

How do I collect all the logs received from the users Chrome extension’s console to a file, to use the ELK stack.
Do you know any tools can help me?