if (logfile == null) return;
    private void rotateLogFile () throws IOException {	if (writer != null) try {	    writer.close();	} catch (Exception ignore) {}	if (logfile.exists()) {	    String today = aformat.format(new Date());	    int ct=0;	    File archive = null;	    // first append just the date	    String archname = filename+"-"+today+".log.gz";	    while (archive==null || archive.exists()) {	        archive = new File (logdir, archname);	        // for the next try we append a counter	        String archidx = ct>999 ? Integer.toString(ct) : nformat.format (++ct);	        archname = filename+"-"+today+"-"+ archidx +".log.gz";	    }	    if (logfile.renameTo (archive))	        (new GZipper(archive)).start();	    else	        System.err.println ("Error rotating log file "+canonicalName+". Old file will possibly be overwritten!");	}	writer = new PrintWriter (new FileWriter (logfile), false);    }