         return config.environment
     }
 
-    static let standardOutput = NSFileHandle.fileHandleWithStandardOutput()
+    // static let standardOutput = NSFileHandle.fileHandleWithStandardOutput()
+    // static var outputStream: NSOutputStream {
+    //     let stream = NSOutputStream(toFileAtPath: filePath, append: true) ?? NSOutputStream.outputStreamToMemory()
+    //     stream.open()
+    //     return
+    // }
+
     static func log(values: Any...) {
         let string = values.map { "\($0)" }.joinWithSeparator(" ")
-        if let data = "\n\(string)".dataUsingEncoding(NSUTF8StringEncoding) {
-            standardOutput.writeData(data)
+        print(string)
+        // let filePath = "logs/\(environment.string).log"
+        let filePath = "\(logDirectory)/development.log"
+        do {
+            try NSFileManager.defaultManager().createDirectoryAtPath(logDirectory, withIntermediateDirectories: true, attributes: nil)
+        } catch let error as NSError {
+            print("could not create log directory", error);
+        }
+
+        if let outputStream = NSOutputStream(toFileAtPath: filePath, append: true) {
+            outputStream.open()
+            outputStream.write(string + "\n")
+            outputStream.close()
+        } else {
+            print("Unable to open log file")
         }
     }
 }

    static func start(app: FlyApp, port: Int)
}


    var config: FlyConfig { get set }
    var router: FlyRouter<HTTPRoute> { get }
    init(config: FlyConfig)

    // overrideable, but with default values
    static var logDirectory: String { get }
}

extension FlyApp {
    func setup() { }
    static var logDirectory: String { return "log" }
}

class App: FlyApp {
