vapor / toolbox

Simplifies common command line tasks when using Vapor
MIT License
283 stars 85 forks source link

Logs. #421

Closed LavTeamProject closed 8 months ago

LavTeamProject commented 8 months ago

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.)

LavTeamProject commented 8 months ago

swift run App serve --log debug

serve --log trace

Is it possible to write these logs to a file?

0xTim commented 8 months ago

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