...
Code Block |
---|
public interface FileWriter { /** * append events to file **/ void append(Iterator<LogEvent> events); /** * create a file corresponding to the entityId and timestamp and return the file **/ File createFile(EntityId entityId, long timestamp); /** * close the file **/ void close(File file, long timestamp); /** * flush the contents **/ void flush(); } |
Step3: RotationPolicy
Code Block |
---|
public interface RotationPolicy { /** * For the logEvent, decide if we should rotate the log file corresponding to this event or not. */ boolean shouldRotateFile(LogEvent logEvent); } |
...