Skip to content

Commit 40c95cb

Browse files
committed
backporting of LOGBACK-1175
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
1 parent acdf468 commit 40c95cb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

logback-core/src/main/java/ch/qos/logback/core/rolling/helper/FileNamePattern.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public String toRegexForFixedDate(Date date) {
199199
if (p instanceof LiteralConverter) {
200200
buf.append(p.convert(null));
201201
} else if (p instanceof IntegerTokenConverter) {
202-
buf.append("(\\d{1,3})");
202+
buf.append("(\\d{1,5})");
203203
} else if (p instanceof DateTokenConverter) {
204204
buf.append(p.convert(date));
205205
}

logback-core/src/test/java/ch/qos/logback/core/rolling/helper/FileNamePatternTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ public void asRegexByDate() {
151151
{
152152
FileNamePattern fnp = new FileNamePattern("foo-%d{yyyy.MM.dd}-%i.txt", context);
153153
String regex = fnp.toRegexForFixedDate(cal.getTime());
154-
assertEquals("foo-2003.05.20-(\\d{1,3}).txt", regex);
154+
assertEquals("foo-2003.05.20-(\\d{1,5}).txt", regex);
155155
}
156156
{
157157
FileNamePattern fnp = new FileNamePattern("\\toto\\foo-%d{yyyy\\MM\\dd}-%i.txt", context);
158158
String regex = fnp.toRegexForFixedDate(cal.getTime());
159-
assertEquals("/toto/foo-2003/05/20-(\\d{1,3}).txt", regex);
159+
assertEquals("/toto/foo-2003/05/20-(\\d{1,5}).txt", regex);
160160
}
161161
}
162162

0 commit comments

Comments
 (0)