Clear buffer before send log to log server for simplicity
Add a test case for partial flush