Skip to content

Instantly share code, notes, and snippets.

View adam-fowler's full-sized avatar

Adam Fowler adam-fowler

View GitHub Profile
@adam-fowler
adam-fowler / gist:69897480ce8b78bb445a10b218b0c463
Created September 23, 2019 16:53
Logging Middleware for Vapor
import Vapor
/// Middleware for outputting all http requests and their responses
final class LoggingMiddleware : Middleware, ServiceType {
static func makeService(for container: Container) throws -> Self {
return try .init(environment: container.environment, log: container.make())
}
init(environment: Environment, log: Logger) {
self.environment = environment