code: private synchronized void setFile()
          throws IOException
      {
          // Check directory
          File file = new File(_filename);
          _filename=file.getCanonicalPath();
          file=new File(_filename);
          File dir= new File(file.getParent());
          if (!dir.isDirectory() || !dir.canWrite())
              throw new IOException("Cannot write log directory "+dir);
              
          Date now=new Date();
          
          // Is this a rollover file?
          String filename=file.getName();
          int i=filename.toLowerCase().indexOf(YYYY_MM_DD);
          if (i>=0)
          {
              file=new File(dir,
                            filename.substring(0,i)+
                            _fileDateFormat.format(now)+
                            filename.substring(i+YYYY_MM_DD.length()));
          }
              
          if (file.exists()&&!file.canWrite())
              throw new IOException("Cannot write log file "+file);
  
          // Do we need to change the output stream?
          if (out==null || !file.equals(_file))
          {
              // Yep
              _file=file;
              if (!_append && file.exists())
                  file.renameTo(new File(file.toString()+"."+_fileBackupFormat.format(now)));
              OutputStream oldOut=out;
              out=new FileOutputStream(file.toString(),_append);
              if (oldOut!=null)
                  oldOut.close();
              if(log.isDebugEnabled())log.debug("Opened "+_file);
          }
      }
docs: /* ------------------------------------------------------------