Filter isLoggable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Filter isLoggable method.

This code example shows how to use the following methods:getMessage, getParameters, getResourceBundle
        internalLog(lr);
    } 
 
    protected void internalLog(LogRecord record) {
        Filter filter = getFilter();
        if (filter != null && !filter.isLoggable(record)) {
            return; 
        } 
        String msg = formatMessage(record);
        internalLogFormatted(msg, record);
    } 
 
    protected abstract void internalLogFormatted(String msg, LogRecord record);
 
    protected String formatMessage(LogRecord record) {
        String format = record.getMessage();
        ResourceBundle catalog = record.getResourceBundle();
        if (catalog != null) {
            try { 
                format = catalog.getString(record.getMessage());

5
CodeRank
This code example shows how to use the following methods:getMessage, getParameters, getResourceBundle, setLoggerName, setResourceBundle
    public void setParent(Logger parent) {
        throw new UnsupportedOperationException();
    } 
 
    protected void doLog(LogRecord lr) {
        lr.setLoggerName(getName());
        String rbname = getResourceBundleName();
        if (rbname != null) {
            lr.setResourceBundleName(rbname);
            lr.setResourceBundle(getResourceBundle());
        } 
        internalLog(lr);
    } 
 
    protected void doLog(LogRecord lr, String rbname) {
        lr.setLoggerName(getName());
        if (rbname != null) {
            lr.setResourceBundleName(rbname);
            lr.setResourceBundle(loadResourceBundle(rbname));
        } 

6
CodeRank
This code example shows how to use the following methods:getMessage, getParameters, getResourceBundle
        internalLog(lr);
    } 
 
    protected void internalLog(final LogRecord record) {
        final Filter filter = getFilter();
        if (filter != null && !filter.isLoggable(record)) {
            return; 
        } 
        final String msg = formatMessage(record);
        internalLogFormatted(msg, record);
    } 
 
    protected abstract void internalLogFormatted(String msg, LogRecord record);
 
    protected String formatMessage(final LogRecord record) {
        String format = record.getMessage();
        final ResourceBundle catalog = record.getResourceBundle();
        if (catalog != null) {
            try { 
                format = catalog.getString(record.getMessage());

6
CodeRank
This code example shows how to use the following methods:getMessage, getParameters, getResourceBundle
    } 
 
    protected void internalLog( LogRecord record )
    { 
        Filter filter = getFilter();
        if ( filter != null && !filter.isLoggable( record ) )
        { 
            return; 
        } 
        String msg = formatMessage( record );
        internalLogFormatted( msg, record );
    } 
 
    protected abstract void internalLogFormatted( String msg, LogRecord record );
 
    protected String formatMessage( LogRecord record )
    { 
        String format = record.getMessage();
        ResourceBundle catalog = record.getResourceBundle();
        if ( catalog != null )

6
CodeRank
This code example shows how to use the following methods:getLevel, getMessage, getParameters, getThrown
    @Override 
    public void log(final LogRecord record) {
        if (isFiltered(record)) {
            return; 
        } 
        final org.apache.logging.log4j.Level level = LevelTranslator.toLevel(record.getLevel());
        final Message message = logger.getMessageFactory().newMessage(record.getMessage(), record.getParameters());
        final Throwable thrown = record.getThrown();
        logger.logIfEnabled(FQCN, level, null, message, thrown);
    } 
 
    // support for Logger.getFilter()/Logger.setFilter() 
    boolean isFiltered(final LogRecord logRecord) {
        final Filter filter = getFilter();
        return filter != null && !filter.isLoggable(logRecord);
    } 
 
    @Override 
    public boolean isLoggable(final Level level) {
        return logger.isEnabled(LevelTranslator.toLevel(level));
5
CodeRank
This code example shows how to use the following methods:isLoggable
        message = msg;
    } 
 
    @Override 
    public boolean isLoggable(final LogRecord record) {
        if (wrapped != null && !wrapped.isLoggable(record)) {
            return false; 
        } 
        return !level.equals(record.getLevel()) || !message.equals(record.getMessage());
    } 
} 
3
CodeRank
isLoggable Method Overview
Check if a given log record should be published.
See Code Examples for other Java 8 Filter Methods: