 /// This notification is send _after_ the rotation occurs, but _before_ any pending Log Entries have been written to
 /// the new file.
 public let LXFileEndpointDidRotateFilesNotification:  String = "info.logkit.endpoint.fileEndpoint.didRotateFiles"
+
+/**
+This notification clients can post which will cause any `LXManuallyRotatingFileEndpoint` instances to rotate immediately.
+
+The notification's `object` and `userInfo` fields are ignored.
+*/
+public let LXFileEndpointCauseRotationNotification:   String = "info.logkit.endpoint.fileEndpoint.rotate"
 
 /// The value found at this key is the `NSURL` of the sender's previous log file.
 public let LXFileEndpointRotationPreviousURLKey:      String = "info.logkit.endpoint.fileEndpoint.previousURL"

        }
    }

}



        if let data = string.dataUsingEncoding(NSUTF8StringEncoding) {
            //TODO: might pass test but file fills before write
            if let nextFile = self.rotateToFileBeforeWritingDataWithLength(data.length) {
                rotateTo(nextFile)
            }
            self.currentFile?.writeData(data)
        } else {
            assertionFailure("Failure to create data from entry string")
        }
    }

    /// Sets the current file to the next index and notifies about rotation
    private func rotateTo(nextFile: LXLogFile) {
        //TODO: Move these notifications into property observers, if the properties can be made non-lazy.
        //TODO: Getting `nextURL` from `nextFile`, instead of calculating it again, might be more robust.
        NSNotificationCenter.defaultCenter().postNotificationName(
            LXFileEndpointWillRotateFilesNotification,
            object: self,
            userInfo: [
                LXFileEndpointRotationCurrentURLKey: self.currentURL,
                LXFileEndpointRotationNextURLKey: self.nextURL
            ]
        )

        let previousURL = self.currentURL
        self.currentFile = nextFile
        self.currentIndex = self.nextIndex

        NSNotificationCenter.defaultCenter().postNotificationName(
            LXFileEndpointDidRotateFilesNotification,
            object: self,
            userInfo: [
                LXFileEndpointRotationCurrentURLKey: self.currentURL,
                LXFileEndpointRotationPreviousURLKey: previousURL
            ]
        )
    }

    /// Clears the currently selected file and begins writing again at its beginning.
