mirror of
https://github.com/ctripcorp/zeus.git
synced 2024-11-11 01:24:27 +08:00
fix log line bug
This commit is contained in:
parent
09870c699f
commit
32d515a820
1 changed files with 2 additions and 2 deletions
|
@ -74,7 +74,7 @@ public class AccessLogTracker implements LogTracker {
|
|||
offset = 0;
|
||||
else {
|
||||
// check if log rotate has been done
|
||||
fileChannel.position(curr.rOffset - curr.rValue.getBytes().length - 1);
|
||||
fileChannel.position(curr.rOffset - curr.rValue.getBytes().length - 2);
|
||||
String rafline = raf.readLine();
|
||||
if (rafline.equals(curr.rValue))
|
||||
offset = curr.rOffset;
|
||||
|
@ -129,11 +129,11 @@ public class AccessLogTracker implements LogTracker {
|
|||
break;
|
||||
case '\r':
|
||||
eol = true;
|
||||
fresh = new String(line, 0, colOffset);
|
||||
if ((buffer.get()) != '\n')
|
||||
buffer.position(colOffset);
|
||||
else
|
||||
colOffset++;
|
||||
fresh = new String(line, 0, colOffset);
|
||||
delegator.delegate(fresh);
|
||||
offset += ++colOffset;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue