Package org.jboss.logmanager.handlers

Examples of org.jboss.logmanager.handlers.PeriodicRotatingFileHandler


    private boolean append;
    private String suffix;
    private PeriodicRotatingFileHandler value;

    public synchronized void start(final StartContext context) throws StartException {
        final PeriodicRotatingFileHandler handler = new PeriodicRotatingFileHandler();
        value = handler;
        formatterSpec.apply(handler);
        if (level != null) handler.setLevel(level);
        handler.setAutoFlush(autoflush);
        try {
            handler.setEncoding(encoding);
        } catch (UnsupportedEncodingException e) {
            throw new StartException(e);
        }
        handler.setAppend(append);
        try {
            handler.setFileName(fileName.getValue());
        } catch (FileNotFoundException e) {
            throw new StartException(e);
        }
        handler.setSuffix(suffix);
    }
View Full Code Here


        }
        handler.setSuffix(suffix);
    }

    public synchronized void stop(final StopContext context) {
        final PeriodicRotatingFileHandler handler = value;
        handler.close();
        value = null;
    }
View Full Code Here

        return level;
    }

    public synchronized void setLevel(final Level level) {
        this.level = level;
        final PeriodicRotatingFileHandler handler = value;
        if (handler != null) handler.setLevel(level);
    }
View Full Code Here

        return formatterSpec;
    }

    public synchronized void setFormatterSpec(final AbstractFormatterSpec formatterSpec) {
        this.formatterSpec = formatterSpec;
        final PeriodicRotatingFileHandler handler = value;
        if (handler != null) formatterSpec.apply(handler);
    }
View Full Code Here

        return autoflush;
    }

    public synchronized void setAutoflush(final boolean autoflush) {
        this.autoflush = autoflush;
        final PeriodicRotatingFileHandler handler = value;
        if (handler != null) handler.setAutoFlush(autoflush);
    }
View Full Code Here

    public synchronized String getEncoding() {
        return encoding;
    }

    public synchronized void setEncoding(final String encoding) throws UnsupportedEncodingException {
        final PeriodicRotatingFileHandler handler = value;
        if (handler != null) handler.setEncoding(encoding);
        this.encoding = encoding;
    }
View Full Code Here

        return append;
    }

    public synchronized void setAppend(final boolean append) {
        this.append = append;
        final PeriodicRotatingFileHandler handler = value;
        if (handler != null) handler.setAppend(append);
    }
View Full Code Here

        return suffix;
    }

    public synchronized void setSuffix(final String suffix) {
        this.suffix = suffix;
        final PeriodicRotatingFileHandler handler = value;
        if (handler != null) handler.setSuffix(suffix);
    }
View Full Code Here

    private boolean append;
    private String suffix;
    private PeriodicRotatingFileHandler value;

    public synchronized void start(final StartContext context) throws StartException {
        final PeriodicRotatingFileHandler handler = new PeriodicRotatingFileHandler();
        value = handler;
        if (filter != null) handler.setFilter(filter);
        formatterSpec.apply(handler);
        if (level != null) handler.setLevel(level);
        handler.setAutoFlush(autoflush);
        try {
            handler.setEncoding(encoding);
        } catch (UnsupportedEncodingException e) {
            throw new StartException(e);
        }
        handler.setAppend(append);
        try {
            handler.setFileName(fileName.getValue());
        } catch (FileNotFoundException e) {
            throw new StartException(e);
        }
        handler.setSuffix(suffix);
    }
View Full Code Here

        }
        handler.setSuffix(suffix);
    }

    public synchronized void stop(final StopContext context) {
        final PeriodicRotatingFileHandler handler = value;
        handler.close();
        value = null;
    }
View Full Code Here

TOP

Related Classes of org.jboss.logmanager.handlers.PeriodicRotatingFileHandler

Copyright © 2018 www.massapicom. 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.