Permalink
Browse files

fixed hourly roll period's initial filename

Summary:
When rotate_period=hourly and no logs exist for a given category,
the log's filename is created incorrectly. The filename suffix is 0,
when it should be the current hour.
  • Loading branch information...
1 parent 2ee14d3 commit c375854e49a0751e459eed0f6d348a27036f291e @zxvdr zxvdr committed May 12, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/store.cpp
View
@@ -650,7 +650,12 @@ bool FileStore::openInternal(bool incrementFilename, struct tm* current_time) {
// this is the case where there's no file there and we're not incrementing
if (suffix < 0) {
- suffix = 0;
+ if (rollPeriod == ROLL_HOURLY) {
+ suffix = current_time->tm_hour;
+ }
+ else {
+ suffix = 0;
+ }
}
string file = makeFullFilename(suffix, current_time);

0 comments on commit c375854

Please sign in to comment.