/** * If the value of <b>File</b> is not <code>null</code>, then {@link * #setFile} is called with the values of <b>File</b> and * <b>Append</b> properties. * */ public void activateOptions() { if (fileName != null) { try { setFile(fileName, fileAppend, bufferedIO, bufferSize); } catch (java.io.IOException e) { reportError("setFile(" + fileName + "," + fileAppend + ") call failed.", e, ErrorManager.OPEN_FAILURE); } } else { reportError("File option not set for appender [" + name + "]." +" Are you using FileHandler instead of ConsoleAppender?", null, ErrorManager.OPEN_FAILURE); } }
public void activateOptions() { super.activateOptions(); if (datePattern != null && fileName != null) { now.setTime(System.currentTimeMillis()); sdf = new SimpleDateFormat(datePattern); int type = computeCheckPeriod(); printPeriodicity(type); rc.setType(type); File file = new File(fileName); scheduledFilename = fileName + sdf.format(new Date(file.lastModified())); } else { reportError("Either File or DatePattern options are not set for appender [" + name + "].", null, ErrorManager.OPEN_FAILURE); } }
/** * Instantiate a <code>FileHandler</code> and open the file * designated by <code>filename</code>. The opened filename will * become the output destination for this appender. * <p/> * <p>If the <code>append</code> parameter is true, the file will be * appended to. Otherwise, the file designated by * <code>filename</code> will be truncated before being opened. * <p/> * <p>If the <code>bufferedIO</code> parameter is <code>true</code>, * then buffered IO will be used to write to the output file. */ public FileHandler(Formatter layout, String filename, boolean append, boolean bufferedIO, int bufferSize) throws IOException { super.setFormatter(layout); this.setFile(filename, append, bufferedIO, bufferSize); }
/** * This method differentiates DailyRollingFileAppender from its * super class. * <p/> * <p>Before actually logging, this method will check whether it is * time to do a rollover. If it is, it will schedule the next * rollover time and then rollover. */ protected void subPublish(LogRecord event) { long n = System.currentTimeMillis(); if (n >= nextCheck) { now.setTime(n); nextCheck = rc.getNextCheckMillis(now); try { rollOver(); } catch (IOException ioe) { reportError("rollOver() failed.", ioe, ErrorManager.OPEN_FAILURE); } } super.subPublish(event); } }
public void activateOptions() { super.activateOptions(); if (datePattern != null && fileName != null) { now.setTime(System.currentTimeMillis()); sdf = new SimpleDateFormat(datePattern); int type = computeCheckPeriod(); printPeriodicity(type); rc.setType(type); File file = new File(fileName); scheduledFilename = fileName + sdf.format(new Date(file.lastModified())); } else { reportError("Either File or DatePattern options are not set for appender [" + name + "].", null, ErrorManager.OPEN_FAILURE); } }
/** * Instantiate a <code>FileHandler</code> and open the file * designated by <code>filename</code>. The opened filename will * become the output destination for this appender. * <p/> * <p>If the <code>append</code> parameter is true, the file will be * appended to. Otherwise, the file designated by * <code>filename</code> will be truncated before being opened. * <p/> * <p>If the <code>bufferedIO</code> parameter is <code>true</code>, * then buffered IO will be used to write to the output file. */ public FileHandler(Formatter layout, String filename, boolean append, boolean bufferedIO, int bufferSize) throws IOException { super.setFormatter(layout); this.setFile(filename, append, bufferedIO, bufferSize); }
/** * This method differentiates DailyRollingFileAppender from its * super class. * <p/> * <p>Before actually logging, this method will check whether it is * time to do a rollover. If it is, it will schedule the next * rollover time and then rollover. */ protected void subPublish(LogRecord event) { long n = System.currentTimeMillis(); if (n >= nextCheck) { now.setTime(n); nextCheck = rc.getNextCheckMillis(now); try { rollOver(); } catch (IOException ioe) { reportError("rollOver() failed.", ioe, ErrorManager.OPEN_FAILURE); } } super.subPublish(event); } }
/** * If the value of <b>File</b> is not <code>null</code>, then {@link * #setFile(String)} is called with the values of <b>File</b> and * <b>Append</b> properties. * */ public void activateOptions() { if (fileName != null) { try { setFile(fileName, fileAppend, bufferedIO, bufferSize); } catch (java.io.IOException e) { reportError("setFile(" + fileName + "," + fileAppend + ") call failed.", e, ErrorManager.OPEN_FAILURE); } } else { reportError("File option not set for appender [" + name + "]." +" Are you using FileHandler instead of ConsoleAppender?", null, ErrorManager.OPEN_FAILURE); } }
public void activateOptions() { super.activateOptions(); if (datePattern != null && fileName != null) { now.setTime(System.currentTimeMillis()); sdf = new SimpleDateFormat(datePattern); int type = computeCheckPeriod(); printPeriodicity(type); rc.setType(type); File file = new File(fileName); scheduledFilename = fileName + sdf.format(new Date(file.lastModified())); } else { reportError("Either File or DatePattern options are not set for appender [" + name + "].", null, ErrorManager.OPEN_FAILURE); } }
/** * Instantiate a <code>FileHandler</code> and open the file * designated by <code>filename</code>. The opened filename will * become the output destination for this appender. * <p/> * <p>If the <code>append</code> parameter is true, the file will be * appended to. Otherwise, the file designated by * <code>filename</code> will be truncated before being opened. * <p/> * <p>If the <code>bufferedIO</code> parameter is <code>true</code>, * then buffered IO will be used to write to the output file. * @param layout * @param filename * @param append * @param bufferedIO * @param bufferSize * @throws IOException */ public FileHandler(Formatter layout, String filename, boolean append, boolean bufferedIO, int bufferSize) throws IOException { super.setFormatter(layout); this.setFile(filename, append, bufferedIO, bufferSize); }
/** * This method differentiates DailyRollingFileAppender from its * super class. * <p/> * <p>Before actually logging, this method will check whether it is * time to do a rollover. If it is, it will schedule the next * rollover time and then rollover. */ protected void subPublish(LogRecord event) { long n = System.currentTimeMillis(); if (n >= nextCheck) { now.setTime(n); nextCheck = rc.getNextCheckMillis(now); try { rollOver(); } catch (IOException ioe) { reportError("rollOver() failed.", ioe, ErrorManager.OPEN_FAILURE); } } super.subPublish(event); } }
/** * If the value of <b>File</b> is not <code>null</code>, then {@link * #setFile} is called with the values of <b>File</b> and * <b>Append</b> properties. * */ public void activateOptions() { if (fileName != null) { try { setFile(fileName, fileAppend, bufferedIO, bufferSize); } catch (java.io.IOException e) { reportError("setFile(" + fileName + "," + fileAppend + ") call failed.", e, ErrorManager.OPEN_FAILURE); } } else { reportError("File option not set for appender [" + name + "]." +" Are you using FileHandler instead of ConsoleAppender?", null, ErrorManager.OPEN_FAILURE); } }