Why does Java Logging API create so many files?

Posted by rgksugan on Stack Overflow See other posts from Stack Overflow or by rgksugan
Published on 2010-05-03T06:07:14Z Indexed on 2010/05/03 6:18 UTC
Read the original article Hit count: 297

Filed under:
|
|

I am using java logging api to log errors in my exception. I am writing these errors to a log file. When i run my program i find a lot of files created.There are around 50 files created. Is there any mistake in my code or is it normal?

Here goes the code

try {
        logger = Logger.getLogger(Reciever.class.getName());
        fileHandler = new FileHandler("Applicationlog.log", true);
        logger.addHandler(fileHandler);
        logger.setLevel(Level.ALL);
        SimpleFormatter formatter = new SimpleFormatter();
        fileHandler.setFormatter(formatter);
    } catch (IOException ex) {
        logger.log(Level.SEVERE, null, ex);
    } catch (SecurityException ex) {
        logger.log(Level.SEVERE, null, ex);
    }

© Stack Overflow or respective owner

Related posts about java

Related posts about logging