I hope you could help me, I\'m trying to call in the date from another class and looks like \"2011-03-09 06-57-40\", I want to use this to create the file below but everytim
public class BELogs {
private final static Logger logger = Logger.getLogger(BSELogs.class
.getName());
boolean makeDir = false;
Date date = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy") ;
String curDate =dateFormat.format(date);
FileHandler fh;
public BSELogs() {
try {
File file = new File("/home//Desktop/Logs "+curDate);
makeDir = file.mkdir();
fh = new FileHandler(file+"/MyLogFile.log "+curDate,true);
logger.addHandler(fh);
// Set the logger level to produce logs at this level and above.
logger.setLevel(Level.FINE);
SimpleFormatter formatter = new SimpleFormatter();
fh.setFormatter(formatter);
} catch (SecurityException ex) { **strong text**
ex.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
logger.info("Data Log Genrated............");
}
}