fullLogFileName.append (newfileName);
fullLogFileName.append (correctFilename(newfileName.toString()));
    public File createFile(String fileExtension) throws Exception {        // check the path ends correctly        if (!path.endsWith(File.separator)) {            path += File.separator;        }        {            //Create new dir if it does not exist            File parentDir = new File(path);            parentDir.mkdir();        }        fullLogFileName.append(path);        StringBuffer newfileName=new StringBuffer();        if ((fileNamePrefix!=null)){            if ((newfileName.toString().length()>0)&&!(newfileName.toString().endsWith("_"))) {                            newfileName.append("_");            }          newfileName.append(fileNamePrefix);        }        if (useHostNameInFileName) {            try {                String hostname = java.net.InetAddress.getLocalHost().getCanonicalHostName();                if ((newfileName.toString().length()>0)&&!(newfileName.toString().endsWith("_"))) {                                newfileName.append("_");                }                newfileName.append(hostname);            } catch (UnknownHostException ex) {                if (isErrorEnabled()) error("",ex);            }        }        if (useProcessNameInFileName) {            String processName = System.getProperty(SmartFrogCoreProperty.propBaseSFProcess +SmartFrogCoreKeys.SF_PROCESS_NAME);            if (processName!=null) {                if ((newfileName.toString().length()>0) && !(newfileName.toString().endsWith("_"))) {                    newfileName.append("_");                }                newfileName.append(processName);            }        }        if (useLogNameInFileName) {            if ((newfileName.toString().length()>0)&&!(newfileName.toString().endsWith("_"))) {                            newfileName.append("_");            }           newfileName.append(logName);        }        if (datedName){            /** Used to format times in filename */            DateFormat dateFileNameFormatter = null;            dateFileNameFormatter = new SimpleDateFormat("yyyyMMdd-HHmmss_SSSzzz");            if ((newfileName.toString().length()>0)&&!(newfileName.toString().endsWith("_"))) {                            newfileName.append("_");            }            // add the extension            newfileName.append(dateFileNameFormatter.format(new Date()));        }        // add the extension        newfileName.append("."+fileExtension);        fullLogFileName.append (newfileName);        //Return file        return new File( correctFilename(fullLogFileName.toString()));    }