use of ch.qos.logback.core.status.ErrorStatus in project rocketmq by apache.
the class RocketmqLogbackAppender method start.
/**
* Options are activated and become effective only after calling this method.
*/
public void start() {
int errors = 0;
if (this.layout == null) {
addStatus(new ErrorStatus("No layout set for the RocketmqLogbackAppender named \"" + name + "\".", this));
errors++;
}
if (errors > 0 || !checkEntryConditions()) {
return;
}
try {
producer = ProducerInstance.getProducerInstance().getInstance(nameServerAddress, producerGroup);
} catch (Exception e) {
addError("Starting RocketmqLogbackAppender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
}
if (producer != null) {
super.start();
}
}
use of ch.qos.logback.core.status.ErrorStatus in project rocketmq-externals by apache.
the class RocketmqLogbackAppender method start.
/**
* Options are activated and become effective only after calling this method.
*/
public void start() {
int errors = 0;
if (this.layout == null) {
addStatus(new ErrorStatus("No layout set for the RocketmqLogbackAppender named \"" + name + "\".", this));
errors++;
}
if (errors > 0 || !checkEntryConditions()) {
return;
}
try {
producer = ProducerInstance.getProducerInstance().getInstance(nameServerAddress, producerGroup);
} catch (Exception e) {
addError("Starting RocketmqLogbackAppender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
}
if (producer != null) {
super.start();
}
}
use of ch.qos.logback.core.status.ErrorStatus in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class RocketmqLogbackAppender method start.
/**
* Options are activated and become effective only after calling this method.
*/
public void start() {
int errors = 0;
if (this.layout == null) {
addStatus(new ErrorStatus("No layout set for the RocketmqLogbackAppender named \"" + name + "\".", this));
errors++;
}
if (errors > 0 || !checkEntryConditions()) {
return;
}
try {
producer = ProducerInstance.getInstance(nameServerAddress, producerGroup);
} catch (Exception e) {
addError("Starting RocketmqLogbackAppender [" + this.getName() + "] nameServerAddress:" + nameServerAddress + " group:" + producerGroup + " " + e.getMessage());
}
if (producer != null) {
super.start();
}
}
use of ch.qos.logback.core.status.ErrorStatus in project minijax by minijax.
the class CloudWatchAppender method start.
@Override
public synchronized void start() {
if (isStarted()) {
return;
}
if (layout == null) {
layout = new EchoLayout<>();
addStatus(new WarnStatus("No layout, default to " + layout, this));
}
if (logGroupName == null) {
logGroupName = getClass().getSimpleName();
addStatus(new WarnStatus("No logGroupName, default to " + logGroupName, this));
}
if (logStreamName == null) {
logStreamName = new SimpleDateFormat("yyyyMMdd'T'HHmmss").format(new Date());
addStatus(new WarnStatus("No logGroupName, default to " + logStreamName, this));
}
try {
if (awsLogs == null) {
awsLogs = AWSLogsClientBuilder.defaultClient();
}
createLogGroup();
createLogStream();
} catch (final AmazonClientException e) {
awsLogs = null;
addStatus(new ErrorStatus(e.getMessage(), this, e));
}
// Start a new daemon time thread to periodically upload events
// Because this is a deamon thread, it will not block shutdown
new DaemonTimerThread().start();
// Add a shutdown hook to catch any final events at shutdown
Runtime.getRuntime().addShutdownHook(new ShutdownHook());
layout.start();
super.start();
}
use of ch.qos.logback.core.status.ErrorStatus in project UniversalMediaServer by UniversalMediaServer.
the class FrameAppender method start.
/**
* Checks that the required parameters are set and if everything is in
* order, activates this appender.
*/
@Override
public void start() {
boolean error = false;
if (this.encoder == null) {
error = true;
addStatus(new ErrorStatus("No encoder set for the appender named [" + name + "].", this));
}
if (!error) {
super.start();
}
}
Aggregations