Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. import java.io.IOException;
  2.  
  3. public class SaveLogToFile {
  4.    
  5.     static Logger log = Logger.getLogger(SaveLogToFile.class);
  6.    
  7.     public static void main(String[] args) throws IOException{
  8.         BasicConfigurator.configure();
  9.         Appender fh = new FileAppender(new SimpleLayout(), "abc.log");
  10.         log.addAppender(fh);
  11.         fh.setLayout(new SimpleLayout());
  12.         log.error("kjisaghfjdgaesfk");
  13.        
  14.     }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement