A first DRAFT of a solution in x4juli, solving the symptom not the reason.

    /**
     * Method especially for public slf4j log methods which have an object
or object[]
     * as parameter for the message formatting.
     * @param level is not allowed to be null.
     * @param message to format with args to complete logging.
     * @param args for message format.
     * @since 0.7
     */
    protected void robustLogSlf4j(final Level level, final String message,
Object[] args){
        String mes = null;
        try {
            mes = org.slf4j.impl.MessageFormatter.arrayFormat(message,
args);
        } catch (Exception e) {
            mes = message + " Error in formatting message["+e+"]";
        }
        LogRecord logRecord = new ExtendedLogRecordImpl(level, mes);
        completeLogRecord((ExtendedLogRecord)logRecord);
        super.log(logRecord);
    }
_______________________________________________
dev mailing list
[email protected]
http://slf4j.org/mailman/listinfo/dev

Reply via email to