void onAppend(LoggingEvent event) {
// Attach the event to the current thread.
if (ComponentsContextManager.isContextStarted()) {
ThreadProfile threadProfile = Profiler.lookup().getCurrentThreadProfile();
if (threadProfile != null) threadProfile.addLog4JEvent(event);
}
// Calculate the current throughput.
calculateThroughput();
// Avoid high throughput.