Skip to content
Init is here / May 19 - 23
Back

Logs do not work when debugging openruntimes locally

  • 0
  • Functions
Alejandro
22 May, 2025, 21:11

Hey there. Trying to debug some openruntimes functions locally. I manage to run the server and make requests to it, but for some reason the logger is not printing the context log & errors in the console.

TL;DR
Developers trying to debug openruntimes locally using the appwrite CLI are facing issues where logs are not showing in the terminal. The logs are being written to `~/.appwrite/logs.txt`, which Docker might not have access to. The logs can be found inside `/mnt/logs/*.log` instead. The code snippet provided shows the use of `Context.Log` but nothing gets printed in the terminal.
Alejandro
22 May, 2025, 21:11

Preparing for start ... Starting ... HTTP server successfully started!

Alejandro
22 May, 2025, 21:13
TypeScript
func CreateCheckoutSession(Context openruntimes.Context) openruntimes.Response {
    request := &CheckoutSessionRequest{}
    err := Context.Req.BodyJson(&request)
    if err != nil {
        Context.Log(err.Error())
        return Context.Res.Redirect(Context.Req.Scheme+"://"+Context.Req.Headers["host"]+"/", Context.Res.WithStatusCode(303))
    }

    _, ok := Context.Req.Headers["x-appwrite-user-id"]
    if !ok {
        Context.Log("User not logged in")
        return Context.Res.Redirect(request.FailureURL, Context.Res.WithStatusCode(303))
...

As you can see I'm using Context.Log but nothing gets printed in the terminal

Alejandro
22 May, 2025, 21:13

I can see the logs flowing inside /mnt/logs/*.log tho

Steven
22 May, 2025, 21:28

in the dev.log file, right?

Alejandro
22 May, 2025, 21:28

Yes, that’s right

Steven
22 May, 2025, 21:29

so the CLI writes logs to ~/.appwrite/logs.txt. Perhaps docker doesn't have access to that location?

Alejandro
22 May, 2025, 21:33

I'm using this command: docker run -p 3000:3000 -e OPEN_RUNTIMES_SECRET=secret-key --rm --interactive --tty --volume $PWD/code.tar.gz:/mnt/code/code.tar.gz:ro openruntimes/go:v4-1.23 sh helpers/start.sh "/usr/local/server/src/function/server"

Alejandro
22 May, 2025, 21:33
Alejandro
22 May, 2025, 21:35

My idea was to develop locally using openruntimes and get the code ready before push it. Can the appwrite CLI be used for this use case?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more