code: func (w *FileLogWriter) DoRotate() error {
  	_, err := os.Lstat(w.Filename)
  	if err == nil { // file exists
  		// Find the next available number
  		num := 1
  		fname := ""
  		for ; err == nil && num <= 999; num++ {
  			fname = w.Filename + fmt.Sprintf(".%s.%03d", time.Now().Format("2006-01-02"), num)
  			_, err = os.Lstat(fname)
  		}
  		// return error if the last file checked still existed
  		if err == nil {
  			return fmt.Errorf("rotate: cannot find free log number to rename %s", w.Filename)
  		}
  
  		// block Logger's io.Writer
  		w.mw.Lock()
  		defer w.mw.Unlock()
  
  		fd := w.mw.fd
  		fd.Close()
  
  		// close fd before rename
  		// Rename the file to its newfound home
  		if err = os.Rename(w.Filename, fname); err != nil {
  			return fmt.Errorf("Rotate: %s", err)
  		}
  
  		// re-start logger
  		if err = w.StartLogger(); err != nil {
  			return fmt.Errorf("Rotate StartLogger: %s", err)
  		}
  
  		go w.deleteOldLog()
  	}
  
  	return nil
  }
docs: // DoRotate means it need to write file in new file.
  // new file name like xx.log.2013-01-01.2