srfinal(student detail)

Posted in By me mama 0 comments

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

/**
 *
 * @author Sewranga
 */
public class Srfinal {

    /**
     * @param args the command line arguments
     */

        // TODO code application logic here
        static final Logger Log=Logger.getLogger(Srfinal.class.getName());
        FileHandler fileHandler;
        public void logging(String massage) throws IOException{
            try {
                fileHandler=new FileHandler("log.txt");
                SimpleFormatter as=new SimpleFormatter();
                fileHandler.setFormatter( as );
                Log.info(massage);
           
            } catch (IOException ex) {
                Logger.getLogger(Srfinal.class.getName()).log(Level.SEVERE ,null, ex);            
            }
            catch(SecurityException ex){
                Logger.getLogger(Srfinal.class.getName()).log(Level.SEVERE,null,ex);
            }
        }
       
   
}