use of ch.qos.logback.core.status.WarnStatus in project cdap by caskdata.
the class CDAPLogAppender method doAppend.
@Override
public void doAppend(ILoggingEvent eventObject) throws LogbackException {
if (logFileManager == null) {
return;
}
long timestamp = eventObject.getTimeStamp();
try {
// logic from AppenderBase
if (!this.started) {
addStatus(new WarnStatus("Attempted to append to non started appender [" + name + "].", this));
return;
}
// logic from AppenderBase
if (getFilterChainDecision(eventObject) == FilterReply.DENY) {
return;
}
LogPathIdentifier logPathIdentifier = getLoggingPath(eventObject.getMDCPropertyMap());
LogFileOutputStream outputStream = logFileManager.getLogFileOutputStream(logPathIdentifier, timestamp);
outputStream.append(eventObject);
} catch (IllegalArgumentException iae) {
// this shouldn't happen
LOG.error("Unrecognized context ", iae);
} catch (IOException ioe) {
throw new LogbackException("Exception during append", ioe);
}
}
use of ch.qos.logback.core.status.WarnStatus in project cassandra by apache.
the class ConsoleAppender method setTarget.
public void setTarget(String target) {
if (!(target.equals("System.out") || target.equals("System.err"))) {
Status status = new WarnStatus("[" + target + "] should be one of System.out or System.err", this);
status.add(new WarnStatus("Using default target System.out", this));
addStatus(status);
return;
}
this.target = target;
}
Aggregations