I'm pretty new in Java but I have to write a simple logger.
My problem is that my logger won't transfer its handler.

My first class is:

```
public class LoggerClass {
    static final Logger logger = Logger.getLogger("myLogger");

    FileHandler fh;  
        public LoggerClass() {
        try {
            this.fh = new FileHandler("C:/Users/Administrator/Desktop/Logging%u.txt");
        } catch (IOException | SecurityException ex) {
            Logger.getLogger(LoggerClass.class.getName()).log(Level.SEVERE, null, ex);
        }
        logger.addHandler(fh);
        SimpleFormatter formatter = new SimpleFormatter();  
        fh.setFormatter(formatter); 

    }

}

```

and i want to transfer the logger to another class by doing this:

```
package Logger;
import static Logger.LoggerClass.logger;
import java.io.IOException;
import java.util.logging.Level;

public class LoggingTest {

    public static void main(String[] args) throws IOException {

        try
    {
      ((Object) null).toString();
    }
    catch ( Exception e )
    {
      logger.log( Level.SEVERE, "oh oh", e );
    }

    logger.info( "Hat funktioniert" );
  }
    }

```

i tried nearly everything that i've found, and the logger functions but it only gives its output on console and not how it should be in a file