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.
Preparing for start ...
Starting ...
HTTP server successfully started!
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
I can see the logs flowing inside /mnt/logs/*.log tho
in the dev.log file, right?
Yes, that’s right
so the CLI writes logs to ~/.appwrite/logs.txt. Perhaps docker doesn't have access to that location?
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"
Which is part of the usage guide in the repo https://github.com/open-runtimes/open-runtimes/tree/main/runtimes/go
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?
Recommended threads
- DeploymentStatus enum value `canceled` m...
Hey, Sorry if it has been reported already, I found an issue using the Dart SDK where the `canceled` enum value is missing from `DeploymentStatus`. This causes...
- Synchronous function execution timeout w...
I am calling server functions with xasync = true and I still get this error message. Synchronous function execution timed out. Use asynchronous execution inste...
- Function running for more than 2 hours i...
This is my projectID: 669fe01b003800dd0503 Cloud functionID is 696ea05400147eb8eb3b I hope this doesn't count against my GB-hours?