Environment:
Vapor 4.77
MacOS 13.5
Running on LocalHost:8080
Scenario:
In the configure file:
var logger = Logger(label: "com.amourinetech.realtor")
logger.logLevel = .info
app.logger = logger
In the routes file:
func routes(_ app: Application) throws {
app.get("hello") { req async -> String in
app.logger.debug("Realtor says 'Hello Ric!")
return "Hello, world!"
}
try app.register(collection: RealtorController())
}
I tried to elevate the message to '.debug' but it made no difference:
Apparently, the console only shows INFO, not DEBUG information:
I tried searching the system.log via the Console for 'info' or 'realtor', etc. but found nothing.
Vapor's ConsoleLogger (which is the default) for Vapor applications doesn't have any knowledge or interaction of OSLog which is what you need to make logs appear in the system log I believe.
You can bootstrap a different logging backend that builds on SwiftLog easily. There are a couple of options that try and unify the two logging systems but it's not a clear match up so not everything works