vapor/toolbox

Logs.

LavTeamProject opened this issue · 2 comments

Hello!
I installed ubuntu 20.04 + vapor + supervisor.
Everything works, but I can’t find where the logs are written (code execution errors, decoding errors, etc.)

swift run App serve --log debug

serve --log trace

Is it possible to write these logs to a file?

0xTim commented

Vapor's logger logs out to the console by default. You have a couple of options - choose a different logger from https://github.com/apple/swift-log#selecting-a-logging-backend-implementation-applications-only that has the behaviour you want, or if you're using supervisor you can choose where it pipes stdout logs as per the Vapor docs - https://docs.vapor.codes/deploy/supervisor/#configure