private boolean checkActivate() { if (!activated) { try { activated = activateHandler(); } catch (Exception e) { Kernel.logError("Fail to active appender " + this.getClass() + ". Cause " + e.getMessage()); } } return activated; }
/** * Handle log message * * @param msg Log message */ public synchronized void doAppend(LogMessage msg) { checkActivate(); if (filter != null && filter.filter(msg) != LoggerFilter.ALLOW) { return; } String log = null; if (layout != null && needPattern() && layout.getConvertor() != null) { log = layout.format(msg); } try { append(msg, log); } catch (Exception e) { Kernel.logError(e.getMessage(), e); } }