Permalink
Browse files

Some cleanup up date formatting and roll logic for max file size rota…

…tion
  • Loading branch information...
Jamie Paulson
Jamie Paulson committed Jun 17, 2011
1 parent 257b13b commit b05ba2427ea0c068dbd58950ab971935ba893e96
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/scala/net/lag/logging/FileHandler.scala
@@ -86,7 +86,7 @@ class FileHandler(val filename: String, val policy: Policy, formatter: Formatter
case Hourly => new SimpleDateFormat("yyyyMMdd-HH")
case Daily => new SimpleDateFormat("yyyyMMdd")
case Weekly(_) => new SimpleDateFormat("yyyyMMdd")
- case MaxSize(_) => new SimpleDateFormat("yyyyMMdd-hhmmss")
+ case MaxSize(_) => new SimpleDateFormat("yyyyMMdd-HHmmss")
}
dateFormat.setCalendar(formatter.calendar)
dateFormat.format(date)
@@ -166,7 +166,7 @@ class FileHandler(val filename: String, val policy: Policy, formatter: Formatter
if (System.currentTimeMillis > nextRollTime) {
roll
}
- if (maxFileSizeBytes != Long.MaxValue && bytesWrittenToFile + lineSizeBytes > maxFileSizeBytes) {
+ if (bytesWrittenToFile + lineSizeBytes > maxFileSizeBytes) {
roll
}
stream.write(formattedLine)

0 comments on commit b05ba24

Please sign in to comment.