Examples of SimpleFormatter


Examples of java.util.logging.SimpleFormatter

  if (m_Filename != null) {
    m_Logger = Logger.getLogger(m_Filename);
    Handler fh = null;
    try{      
      fh = new FileHandler(m_Filename, m_Size, m_NumFiles);
      fh.setFormatter(new SimpleFormatter());
      m_Logger.addHandler(fh);     
      m_LoggerInitFailed = false;
    }
    catch(Exception e) {
      System.out.println("Cannot init fileHandler for logger:" + e.toString());
View Full Code Here

Examples of java.util.logging.SimpleFormatter

    log.setLevel(Level.ALL);//Log all events
   
    try {
      FileHandler fileHandler = new FileHandler(ConfigurationManager.LOGS_DIR+File.separator+"JMule%u.log",(int)ConfigurationManager.LOG_FILE_SIZE,ConfigurationManager.LOG_FILES_NUMBER);
     
      fileHandler.setFormatter(new SimpleFormatter());
     
      log.addHandler(fileHandler);
     
    } catch (Throwable e) {
     
View Full Code Here

Examples of java.util.logging.SimpleFormatter

public final class ConsoleOutHandler extends StreamHandler {

    public ConsoleOutHandler() {
        setLevel(Level.FINEST);
        setFormatter(new SimpleFormatter());
        setOutputStream(System.out);       
    }
View Full Code Here

Examples of java.util.logging.SimpleFormatter

        Formatter f = null;
        try {
            final Class<?> c = Class.forName(name);
            f = (Formatter)c.newInstance();
        } catch (final Exception e) {
            f = new SimpleFormatter();
        }
        return f;
    }   
View Full Code Here

Examples of java.util.logging.SimpleFormatter

        Formatter f = null;
        try {
            final Class<?> c = Class.forName(name);
            f = (Formatter)c.newInstance();
        } catch (final Exception e) {
            f = new SimpleFormatter();
        }
        return f;
    }
View Full Code Here

Examples of java.util.logging.SimpleFormatter

            Level.FINE.getLocalizedName(),
            Level.CONFIG.getLocalizedName(),
            Level.INFO.getLocalizedName(),
            Level.WARNING.getLocalizedName(),
            Level.SEVERE.getLocalizedName()};
        logFormatter = new SimpleFormatter();
        logOpt = new  StringParam(
            Strings.get("LoggerCmdLineHandler.logOpt.tag"),
            Strings.get("LoggerCmdLineHandler.logOpt.desc", validVals),
            validVals,
            Parameter.OPTIONAL);
View Full Code Here

Examples of java.util.logging.SimpleFormatter

        settingsFile = args.length > 0 ? new File(args[0]) : null;
        try {
            Logger.getLogger("").addHandler(new Handler() {
                {
                    setFormatter(new SimpleFormatter());
                }
                @Override public void publish(final LogRecord record) {
                    final String title;
                    final int messageType;
                    if (record.getLevel().equals(Level.SEVERE)) {
View Full Code Here

Examples of java.util.logging.SimpleFormatter

        settingsFile = args.length > 0 ? new File(args[0]) : null;
        try {
            Logger.getLogger("").addHandler(new Handler() {
                {
                    setFormatter(new SimpleFormatter());
                }
                @Override public void publish(final LogRecord record) {
                    final String title;
                    final int messageType;
                    if (record.getLevel().equals(Level.SEVERE)) {
View Full Code Here

Examples of java.util.logging.SimpleFormatter

    Logger logger = Logger.getLogger("");
    logger.setLevel(Level.INFO);
    txtFile = new FileHandler("Logging.txt",true);
   
    // Create txt Formatter
    formatterTxt = new SimpleFormatter();
    txtFile.setFormatter(formatterTxt);
    logger.addHandler(txtFile);
   
    }catch(IOException ex)
    {
View Full Code Here

Examples of java.util.logging.SimpleFormatter

        initializeLogging(Level.INFO);
    }
   
    public static void initializeLogging(Level consoleLevel) {
        LogManager.getLogManager().reset();
        SimpleFormatter sf = new SimpleFormatter() {
            private final long startMillis = System.currentTimeMillis();
            public String format(LogRecord record) {
                StringBuilder sb = new StringBuilder();
                sb.append(record.getMillis() - startMillis);
                sb.append(" ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.