I want to start a ngrok server and log everything to a file and to the terminal but it isnt working

721 Views Asked by At

Code:

from pyngrok import ngrok

public_url = ngrok.connect(
    log_stdout=True, log_file="ngrok.log", log_format="json", log_level="debug", proto="tcp", addr="8080"
)
print(public_url)
while True:
    pass

I found this on the internet but it aint working, well its starting the server but its not logging anything, how do i make it log things?

thanks

1

There are 1 best solutions below

0
On

I'm not familiar with that approach but in general, you probably want to do it a little bit differently. Check out the local ngrok API - https://ngrok.com/docs/ngrok-agent/api#list-captured-requests - which will let you capture all the requests in JSON for logging, replay, or whatever.

~ an ngrok employee