 
     override public var defaultHashValue: Int {return 2}
     let fileManager = FileManager.default
-    var fileHandle: FileHandle?
 
-    public override init() {
+    public init(logFileURL: URL? = nil) {
+        if let logFileURL = logFileURL {
+            self.logFileURL = logFileURL
+            super.init()
+            return
+        }
+
         // platform-dependent logfile directory default
         var baseURL: URL?
         #if os(OSX)

                        withIntermediateDirectories: true
                    )
                }
                
                // create file if not existing
                let line = str + "\n"
                try line.write(to: url, atomically: true, encoding: .utf8)

                #if os(iOS) || os(watchOS)
                if #available(iOS 10.0, watchOS 3.0, *) {

                    try fileManager.setAttributes(attributes, ofItemAtPath: url.path)
                }
                #endif
            }
            write(data: data, to: url)

            return true
        } catch {
            print("SwiftyBeaver File Destination could not write to file \(url).")
            return false
        }
    }

    private func write(data: Data, to url: URL) {
        let coordinator = NSFileCoordinator(filePresenter: nil)
        var error: NSError?
        coordinator.coordinate(writingItemAt: url, error: &error) { url in
            do {
                let fileHandle = try FileHandle(forWritingTo: url)
                fileHandle.seekToEndOfFile()
                fileHandle.write(data)
                if syncAfterEachWrite {
                    fileHandle.synchronizeFile()
                }
                fileHandle.closeFile()
            } catch {
                print("SwiftyBeaver File Destination could not write to file \(url).")
                return
            }
        }

        if let error = error {
            print("Failed writing file with error: \(String(describing: error))")
        }
    }

