diff --git a/Sources/App/configure.swift b/Sources/App/configure.swift index be848c4..6972954 100644 --- a/Sources/App/configure.swift +++ b/Sources/App/configure.swift @@ -10,8 +10,6 @@ public func configure(_ app: Application) throws { let resourcesFolderUrl = URL(fileURLWithPath: app.directory.resourcesDirectory) let configUrl = resourcesFolderUrl.appendingPathComponent("config.json") - tokenStorage = .init(in: resourcesFolderUrl) - let config: ServerConfiguration do { let data = try Data(contentsOf: configUrl) @@ -20,6 +18,9 @@ public func configure(_ app: Application) throws { print("Failed to load config from \(configUrl.path): \(error)") return } + Log.set(logFile: URL(fileURLWithPath: config.logPath)) + + tokenStorage = .init(in: resourcesFolderUrl) app.http.server.configuration.port = config.port @@ -35,6 +36,7 @@ public func configure(_ app: Application) throws { try routes(app) serverStatus = .running + log(info: "Server is running") } private extension JSONDecoder {