Skip to content

Commit

Permalink
Fix formatter properties init order
Browse files Browse the repository at this point in the history
  • Loading branch information
rfoltyns committed Feb 10, 2021
1 parent 6f4d3a3 commit cbf8f0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ protected RollingIndexNameFormatter(String indexName, String pattern, long initT
this.indexName = indexName;
this.fastDateFormat = FastDateFormat.getInstance(pattern, timeZone);
this.patternProcessor = createPatternProcessor(pattern);
this.currentName = doFormat(indexName, initTimeInMillis);
this.separator = separator;
this.currentName = doFormat(indexName, initTimeInMillis);

long previousTime = this.patternProcessor.getNextTime(initTimeInMillis, -1, false);
this.patternProcessor.setPrevFileTime(previousTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ public void returnsCustomSeparatorFormattedIndexName() {
// given
LogEvent logEvent = mock(LogEvent.class);
when(logEvent.getTimeMillis()).thenReturn(DEFAULT_TEST_TIME_IN_MILLIS);
RollingIndexNameFormatter.Builder builder = createRollingIndexNameFormatterBuilder();
builder.withSeparator(".");
IndexNameFormatter formatter = builder.build();
RollingIndexNameFormatter formatter = createRollingIndexNameFormatterBuilder()
.withSeparator(".")
.build();

// when
String formattedIndexName = formatter.format(logEvent);
Expand Down

0 comments on commit cbf8f0a

Please sign in to comment.