Package java.util.logging

Examples of java.util.logging.Handler


        value = null;
    }

    public synchronized void addProperty(final Property property) {
        properties.add(property);
        final Handler handler = value;
        if (handler != null) {
            setProperties(handler, this.properties);
        }
    }
View Full Code Here


    }


    public synchronized void addProperties(final Collection<Property> properties) {
        this.properties.addAll(properties);
        final Handler handler = value;
        if (handler != null) {
            setProperties(handler, this.properties);
        }
    }
View Full Code Here

        return level;
    }

    public synchronized void setLevel(final Level level) {
        this.level = level;
        final Handler 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 Handler handler = value;
        if (handler != null) formatterSpec.apply(handler);
    }
View Full Code Here

    }

    @Override
    public synchronized void setFilter(final Filter filter) {
        this.filter = filter;
        final Handler handler = value;
        if (handler != null) {
            handler.setFilter(filter);
        }
    }
View Full Code Here

    public synchronized String getEncoding() {
        return encoding;
    }

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

        ServiceController<Handler> handlerController = (ServiceController<Handler>) serviceRegistry.getService(LogServices.handlerName(asyncHandlerName));
        @SuppressWarnings("unchecked")
        ServiceController<Handler> handlerToRemoveController = (ServiceController<Handler>) serviceRegistry.getService(LogServices.handlerName(handlerNameToRemove));

        AsyncHandlerService service = AsyncHandlerService.class.cast(handlerController.getService());
        Handler injectedHandler = handlerToRemoveController.getService().getValue();
        service.removeHandler(injectedHandler);

    }
View Full Code Here

        if (handlers != null) {
            logger.setUseParentHandlers(false);
            StringTokenizer tok = new StringTokenizer(handlers, ",");
            while (tok.hasMoreTokens()) {
                String handlerName = (tok.nextToken().trim());
                Handler handler = null;
                ClassLoader current = classLoader;
                while (current != null) {
                    info = classLoaderLoggers.get(current);
                    if (info != null) {
                        handler = info.handlers.get(handlerName);
View Full Code Here

                        handlerClassName = handlerClassName.substring(pos + 1);
                    }
                }
                try {
                    this.prefix.set(prefix);
                    Handler handler =
                        (Handler) classLoader.loadClass(handlerClassName).newInstance();
                    // The specification strongly implies all configuration should be done
                    // during the creation of the handler object.
                    // This includes setting level, filter, formatter and encoding.
                    this.prefix.set(null);
View Full Code Here

    public void testQuietLogging() throws Exception {

        final List<LogRecord> logRecords = new ArrayList<LogRecord>();
        LogManager logManager = LogManager.getLogManager();
        logManager.reset();
        Handler handler = new Handler() {
            @Override
            public void publish(LogRecord record) {
                logRecords.add(record);
            }
            @Override
View Full Code Here

TOP

Related Classes of java.util.logging.Handler

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.