A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Code Examples of FileHandler


    if (enable) {
      Handler[] handlers = getLogger().getHandlers();
      if (handlers == null || handlers.length == 0) {
        // add default file handler
        try {
          FileHandler fileHandler = new FileHandler(LOG_FILE, false);
          fileHandler.setLevel(Level.ALL);
          fileHandler.setFormatter(new PMLogFormatter());
          getLogger().addHandler(fileHandler);
        } catch (Throwable err) {
          System.err.println("Error initializing log file " + PMController.class.getName() + ": "
                  + err.toString());
        }

View Full Code Here


		}
		catch(NumberFormatException nfe){
			// if its not a number
			if(loggingOut.length()!=0){
				try {
				    outHandlerList.add(new FileHandler(loggingOut,0,getInt("loggings.out.number",1)));
				} catch (SecurityException e) {
					System.err.println("Security prevents logging into files");
				} catch (IOException e) {
					System.err.println("Can not log in "+loggingOut);
				} catch (IllegalArgumentException e){

View Full Code Here


    public Handler createLogHandler() {
        String fileName = getLogFileName();
        Handler h = null;
        try {
	    if (fHandler == null) {
                fHandler = new FileHandler(fileName, true);
	    }
        } catch (Exception e) {
            // If there is an exception in creation of file handler,
            // use a console handler instead.
            // NOI18N

View Full Code Here


		next.add(Calendar.DATE, 1);
		_endDate = next.getTimeInMillis();

		try
		{
			_handler = new FileHandler(pattern, _limit, _count, _append);
			if (_init)
			{
				_handler.setEncoding(this.getEncoding());
				_handler.setErrorManager(this.getErrorManager());
				_handler.setFilter(this.getFilter());

View Full Code Here


			logger = Logger.getLogger("");
			logger.setLevel(Level.FINEST);

			logger = Logger.getLogger("cmptcpserver");
			logger.setLevel(Level.FINEST); 
			txtLog = new FileHandler(logDir+"/cmptcpserver.log");
			//reduce info 
			txtLog.setFormatter(new org.quickserver.util.logging.MicroFormatter());
			logger.addHandler(txtLog);

			myServer.setAppLogger(logger); //imp

View Full Code Here


                    tempFile.delete();
            }
        }
        
        try {
            handler = new FileHandler(dm.getTempDir() + filename);
            handler.setFormatter(new DriveReportFormatter());
            report.addHandler(handler);
        } catch (Exception e) {
            logger.error(e, e);
        }

View Full Code Here


            int count = 1;
            if (nbfile != null && nbfile.length() > 0) {
                count = Integer.parseInt(nbfile);
            }
            try {
                handler = new FileHandler(output, limit, count, appendVal);
            } catch (Exception e) {
                throw new IllegalStateException("Error when building the handler '"
					+ name + "': " + e.getMessage());
            }
        } else {

View Full Code Here

TOP

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

TOP