I can't make my logger to work. Inside my code I have these lines :
private static final Logger log = Logger.getLogger(ServerThread.class.getName());
log.setUseParentHandlers(false);
FileHandler fh = new FileHandler("ex.txt", true);
SimpleFormatter sf = new SimpleFormatter();
fh.setFormatter(sf);
log.addHandler(fh);
log.setLevel(Level.FINE);
And later when I get input from user :
log.log(Level.FINE,inputString);
But all that happens is that fileHandler creates a file ex.txt, but nothing is logged into the file. I am sure that log.log() is being executed.