Understanding Go WAF, Gin Log Output

Asked 1 years ago, Updated 1 years ago, 52 views

I am currently putting Gin and a library (https://github.com/codegangsta/gin) into Docker to auto-reload, but I am having a hard time debugging because I don't know where the log will be thrown up when Gin gets 500 errors.

Ideally, I'd like to be able to check the situation with fmt.Println, or I'd like to get an error somewhere if I get 500........

Do I have to set it up by myself?
For those who know how to debug Go
Thank you for your cooperation

Here is Dockerfile

 FROM golang:latest 

WORKDIR/root

RUN apt-get update\  
&apt-get-y install apt-utils\  
                        build-essential\  
                        libpq-dev\  
                        vim tmux git curl\
                        locales locales-all\ 
                        --no-install-recommendations\
&rm-rf/var/lib/apt/lists/*  

RUN go get github.com/gin-gonic/gin\
&go get-u golang.org/x/lint/golint\  
& go get github.com/codegangsta/gin\
& go get gopkg.in/mgo.v2 

COPY main.go/root 

ENTRYPOINT ["/go/bin/gin"]  
CMD ["-p", "8080", "run", "main.go"] 

go docker

2022-09-30 14:45

1 Answers

So you should have used Docker's logs function
Excuse me

docker logs-f<container_name>


2022-09-30 14:45

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.