T
T
teub742017-07-25 17:59:13
linux
teub74, 2017-07-25 17:59:13

How to write panic logs in Go in ubuntu via systemd?

Recently I noticed a strange feature of the server crash on GO.
The application worked well, for about 10 days. After that, Go suddenly crashed, and nginx began to issue a 502 error.
The application was developed in visual studio code. There, if anything, all panic fell into the debug console.
And now, when I transferred everything to the server and launched it through systemd, I don’t know what to do. Where can I see the logs in case of a panic, or if by default they do not fly into any file, then what needs to be written so that they all fall into the desired file (or if there is a standard existing one that Go itself creates (if it creates at all?))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
evnuh, 2017-07-25
@teub74

If the server was launched through the systemd unit, then the logs from it to journalctl -u unit_name. All output is written to stdout (console), which is intercepted by systemd and processed. Why do you need files?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question