 	}
 
 	public func respond(to request: Request, chainingTo next: Responder) throws -> Response {
-		let requestInTime = Date()
+		let requestInTime: Date = Date()
 		let remoteAddr = request.peerAddress!.address()
 		let method = request.method
 		let url = request.uri
-		// let headers = request.headers
-		let userAgent = request.headers["User-Agent"]
-		var response = try next.respond(to: request)
+
+		let response = try next.respond(to: request)
 
 		let responseTime = Date().timeIntervalSince(requestInTime)
 		let status = response.status.statusCode
 		let httpVersion = "HTTP/\(response.version.major).\(response.version.minor)"
 
+		// TODO: set remoteUser if user authenticated
+		let remoteUser = "-"
+		// TODO: check how to get reponse[content-length]
+		let responseContentLength = "-"
+
+		var referer = "-"
+		if request.headers["referer"] != nil {
+			referer = (request.headers["referer"])!
+		}
+
+		var userAgent = "-"
+		if request.headers["User-Agent"] != nil {
+			userAgent = (request.headers["User-Agent"])!
+		}
+
 		let content: String = {
 			switch format {
 				case "combined":
-					return "\(remoteAddr)\tremote-user\t[date-clf]\t\"\(method)\t\(url)\t\(httpVersion)\"\t\(status)\tresponse-content-length\t\"referrer\"\t\"\(userAgent)\""
+					return "\(remoteAddr)\t-\t\(remoteUser)\t[\(convertDateToCLF(date: requestInTime))]\t\"\(method)\t\(url)\t\(httpVersion)\"\t\(status)\t\(responseContentLength)\t\"\(referer)\"\t\"\(userAgent)\""
 				case "common":
-					return "\(remoteAddr)\tremore-user\t[date-clf]\t\"\(method)\t\(url)\t\(httpVersion)\"\t\(status)\t\response-content-length"
+					return "\(remoteAddr)\t-\t\(remoteUser)\t[\(convertDateToCLF(date: requestInTime))]\t\"\(method)\t\(url)\t\(httpVersion)\"\t\(status)\t\\(responseContentLength)"
 				case "dev":
-					return "\(method)\t\(url)\t\(status)\t\(responseTime) ms\tresponse-content-length"
+					return "\(method)\t\(url)\t\(status)\t\(responseTime) ms\t\(responseContentLength)"
 				case "short":
-					return "\(remoteAddr)\tremote-user\t\(method)\t\(url)\t\(httpVersion)\t\(status)\tresponse-content-length\t\(responseTime) ms"
+					return "\(remoteAddr)\t\(remoteUser)\t\(method)\t\(url)\t\(httpVersion)\t\(status)\t\(responseContentLength)\t\(responseTime) ms"
 				case "tiny":
-					return "\(method)\t\(url)\t\(status)\tresponse-content-length\t\(responseTime) ms"
+					return "\(method)\t\(url)\t\(status)\t\(responseContentLength)\t\(responseTime) ms"
 				default:
-					return "\(remoteAddr)\tremote-user\t[date-clf]\t\"\(method)\t\(url)\t\(httpVersion)\"\t\(status)\t\response-content-length\t\"referrer\"\t\"(userAgent)\""
+					return "\(remoteAddr)\t\(remoteUser)\t[\(convertDateToCLF(date: requestInTime))]\t\"\(method)\t\(url)\t\(httpVersion)\"\t\(status)\t\\(responseContentLength)\t\"\(referer)\"\t\"(userAgent)\""
 			}
 		}()
 

	public init(format: String) {
		self.format = format
	}
	public convenience init() {
		self.init(format: "combined")
	}

				}
				if let fileHandle = fileHandle {
					let _ = fileHandle.seekToEndOfFile()
					if let data = (content + "\n").data(using: String.Encoding.utf8) {
						fileHandle.write(data)
					}
				}
