Source:
<code>public LegacyRollingFileHandler(String filename, int maxHistory, long maxSizeInBytes) { setFormatter(new StaticFormatter()); ContextBase context = new ContextBase(); if (Files.isSymbolicLink(Paths.get(filename))) { try { Files.delete(Paths.get(filename)); } catch (IOException e) { <START> throw new UncheckedIOException("Unable to remove symlink", e); <END> } } try { recoverTempFiles(filename); } catch (IOException e) { reportError(null, e, OPEN_FAILURE); } RollingFileAppender<String> fileAppender = new RollingFileAppender<>(); TimeBasedRollingPolicy<String> rollingPolicy = new TimeBasedRollingPolicy<>(); SizeAndTimeBasedFNATP<String> triggeringPolicy = new SizeAndTimeBasedFNATP<>(); rollingPolicy.setContext(context); rollingPolicy.setFileNamePattern(filename + "-%d{yyyy-MM-dd}.%i.log.gz"); rollingPolicy.setMaxHistory(maxHistory); rollingPolicy.setTimeBasedFileNamingAndTriggeringPolicy(triggeringPolicy); rollingPolicy.setParent(fileAppender); rollingPolicy.setTotalSizeCap(new FileSize(LongMath.saturatedMultiply(maxSizeInBytes, maxHistory))); triggeringPolicy.setContext(context); triggeringPolicy.setTimeBasedRollingPolicy(rollingPolicy); triggeringPolicy.setMaxFileSize(new FileSize(maxSizeInBytes)); fileAppender.setContext(context); fileAppender.setFile(filename); fileAppender.setAppend(true); fileAppender.setBufferSize(BUFFER_SIZE_IN_BYTES); fileAppender.setEncoder(new StringEncoder()); fileAppender.setRollingPolicy(rollingPolicy); asyncAppender = new AsyncAppenderBase<>(); asyncAppender.setContext(context); asyncAppender.addAppender(fileAppender); rollingPolicy.start(); triggeringPolicy.start(); fileAppender.start(); asyncAppender.start(); }</code><technical_language>Add filename exception message if show up</technical_language>

Target:
public LegacyRollingFileHandler(String filename, int maxHistory, long maxSizeInBytes) { setFormatter(new StaticFormatter()); ContextBase context = new ContextBase(); if (Files.isSymbolicLink(Paths.get(filename))) { try { Files.delete(Paths.get(filename)); } catch (IOException e) { throw new UncheckedIOException("Unable to remove symlink: " + filename, e); } } try { recoverTempFiles(filename); } catch (IOException e) { reportError(null, e, OPEN_FAILURE); } RollingFileAppender<String> fileAppender = new RollingFileAppender<>(); TimeBasedRollingPolicy<String> rollingPolicy = new TimeBasedRollingPolicy<>(); SizeAndTimeBasedFNATP<String> triggeringPolicy = new SizeAndTimeBasedFNATP<>(); rollingPolicy.setContext(context); rollingPolicy.setFileNamePattern(filename + "-%d{yyyy-MM-dd}.%i.log.gz"); rollingPolicy.setMaxHistory(maxHistory); rollingPolicy.setTimeBasedFileNamingAndTriggeringPolicy(triggeringPolicy); rollingPolicy.setParent(fileAppender); rollingPolicy.setTotalSizeCap(new FileSize(LongMath.saturatedMultiply(maxSizeInBytes, maxHistory))); triggeringPolicy.setContext(context); triggeringPolicy.setTimeBasedRollingPolicy(rollingPolicy); triggeringPolicy.setMaxFileSize(new FileSize(maxSizeInBytes)); fileAppender.setContext(context); fileAppender.setFile(filename); fileAppender.setAppend(true); fileAppender.setBufferSize(BUFFER_SIZE_IN_BYTES); fileAppender.setEncoder(new StringEncoder()); fileAppender.setRollingPolicy(rollingPolicy); asyncAppender = new AsyncAppenderBase<>(); asyncAppender.setContext(context); asyncAppender.addAppender(fileAppender); rollingPolicy.start(); triggeringPolicy.start(); fileAppender.start(); asyncAppender.start(); }