mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish "Avoid using deprecated NCSARequestLog"
See gh-16987
This commit is contained in:
parent
4af3badbea
commit
14349518c9
@ -202,14 +202,16 @@ class ServletManagementChildContextConfiguration {
|
||||
|
||||
private void customizeRequestLog(CustomRequestLog requestLog) {
|
||||
if (requestLog.getWriter() instanceof RequestLogWriter) {
|
||||
RequestLogWriter writer = (RequestLogWriter) requestLog.getWriter();
|
||||
String filename = writer.getFileName();
|
||||
if (StringUtils.hasLength(filename)) {
|
||||
File file = new File(filename);
|
||||
file = new File(file.getParentFile(),
|
||||
customizePrefix(file.getName()));
|
||||
writer.setFilename(file.getPath());
|
||||
}
|
||||
customizeRequestLogWriter((RequestLogWriter) requestLog.getWriter());
|
||||
}
|
||||
}
|
||||
|
||||
private void customizeRequestLogWriter(RequestLogWriter writer) {
|
||||
String filename = writer.getFileName();
|
||||
if (StringUtils.hasLength(filename)) {
|
||||
File file = new File(filename);
|
||||
file = new File(file.getParentFile(), customizePrefix(file.getName()));
|
||||
writer.setFilename(file.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user