Polish "Avoid using deprecated NCSARequestLog"

See gh-16987
pull/17049/head
Phillip Webb 6 years ago
parent 4af3badbea
commit 14349518c9

@ -202,14 +202,16 @@ class ServletManagementChildContextConfiguration {
private void customizeRequestLog(CustomRequestLog requestLog) { private void customizeRequestLog(CustomRequestLog requestLog) {
if (requestLog.getWriter() instanceof RequestLogWriter) { if (requestLog.getWriter() instanceof RequestLogWriter) {
RequestLogWriter writer = (RequestLogWriter) requestLog.getWriter(); customizeRequestLogWriter((RequestLogWriter) requestLog.getWriter());
String filename = writer.getFileName(); }
if (StringUtils.hasLength(filename)) { }
File file = new File(filename);
file = new File(file.getParentFile(), private void customizeRequestLogWriter(RequestLogWriter writer) {
customizePrefix(file.getName())); String filename = writer.getFileName();
writer.setFilename(file.getPath()); if (StringUtils.hasLength(filename)) {
} File file = new File(filename);
file = new File(file.getParentFile(), customizePrefix(file.getName()));
writer.setFilename(file.getPath());
} }
} }

Loading…
Cancel
Save