title: why just when i add log to the try block, i can see it at the output file?
body: <p>i tried to provide an logger file output and i saw that only one line is showed at the output file - only the one that inside the try catch block, the others are just at the console</p>
  
  <p>attached here my code for test</p>
  
  <pre><code>public class Something {
  
  Logger logger = Logger.getLogger("");
  FileHandler fh;
  
  @BeforeEach
  public void wallad() {
      System.out.println("hello");
  }
  
  @AfterEach
  public void asddf() {
      System.out.println("pizza");
  }
  
  @Tag("test")
  @Test
  public void some() {
  
      try {
          fh = new FileHandler("C:\\MyLogFile.txt");
          logger.addHandler(fh);
          SimpleFormatter formatter = new SimpleFormatter();  
          fh.setFormatter(formatter);
          logger.log(Level.SEVERE, "severe");-------&gt;only these  
                       will show at the output file
          } 
          catch (Exception e) {
          e.printStackTrace();
          }
  
      logger = Logger.getLogger(Logger.class.getName());
      logger.setLevel(Level.FINEST);
      ConsoleHandler handler = new ConsoleHandler();
          handler.setLevel(Level.ALL);
          logger.addHandler(handler);
          logger.setUseParentHandlers(false);
  
      System.out.println("test1");
      logger.log(Level.WARNING, "warning");
      System.out.println("test2");
      logger.log(Level.INFO, "information");
      System.out.println("test3");
      logger.log(Level.SEVERE, "severe");
      System.out.println("test4");
  
      logger.log(Level.FINEST, "finest");
      System.out.println("test5");
      logger.log(Level.FINE, "fine");
      System.out.println("test6");
      logger.log(Level.FINER, "finer");
      System.out.println("test7");
      logger.log(Level.FINEST, "finest");
  
  }
  }
  </code></pre>
  
  <p>how can i take out all the log file? there is no way that it need to be inside the try catch block</p>