Builds an EventBuilder based on the logging event.

@param loggingEvent Log generated.
@return EventBuilder containing details provided by the logging system.
339786
protected EventBuilder createEventBuilder(LoggingEvent loggingEvent) {
        EventBuilder eventBuilder = new EventBuilder()
            .withSdkIntegration("log4j")
            .withTimestamp(new Date(loggingEvent.getTimeStamp()))
            .withMessage(loggingEvent.getRenderedMessage())
            .withLogger(loggingEvent.getLoggerName())
            .withLevel(formatLevel(loggingEvent.getLevel()))
            .withExtra(THREAD_NAME, loggingEvent.getThreadName());

        ThrowableInformation throwableInformation = null;
        try {
            throwableInformation = loggingEvent.getThrowableInformation();
        } catch (NullPointerException expected) {
            // `throwableInformation` is already set.
        }

        if (throwableInformation != null) {
            Throwable throwable = throwableInformation.getThrowable();
            eventBuilder.withSentryInterface(new ExceptionInterface(throwable));
        } else if (loggingEvent.getLocationInformation().fullInfo != null) {
            LocationInfo location = loggingEvent.getLocationInformation();
            if (!LocationInfo.NA.equals(location.getFileName()) && !LocationInfo.NA.equals(location.getLineNumber())) {
                StackTraceElement[] stackTrace = {asStackTraceElement(location)};
                eventBuilder.withSentryInterface(new StackTraceInterface(stackTrace));
            }
        }

        if (loggingEvent.getNDC() != null) {
            eventBuilder.withExtra(LOG4J_NDC, loggingEvent.getNDC());
        }

        Set<String> extraTags = Sentry.getStoredClient().getMdcTags();
        @SuppressWarnings("unchecked")
        Map<String, Object> properties = (Map<String, Object>) loggingEvent.getProperties();
        for (Map.Entry<String, Object> mdcEntry : properties.entrySet()) {
            if (extraTags.contains(mdcEntry.getKey())) {
                eventBuilder.withTag(mdcEntry.getKey(), mdcEntry.getValue().toString());
            } else {
                eventBuilder.withExtra(mdcEntry.getKey(), mdcEntry.getValue());
            }
        }

        return eventBuilder;
    }
653269
function(loggingEvent) {
		return "<div style=\"" + this.getStyle(loggingEvent) + "\">" + loggingEvent.getFormattedTimestamp() + " - " + loggingEvent.level.toString() + " - " + loggingEvent.message + "</div>\n";
	}
902413
private void logEvent(Node node, EventType eventType)
    {
        // Node contains original as well as transactional copy.
        EventLog log = new EventLog(eventType, node);
        eventLogQueue.onEvent(log, eventType);
    }
455140
private Throwable throwable(final LoggingEvent loggingEvent) {
		ThrowableInformation throwableInfo = loggingEvent.getThrowableInformation();
		if (throwableInfo != null)
			return throwableInfo.getThrowable();
		
		Object message = loggingEvent.getMessage();
		if (message instanceof Throwable)
			return (Throwable) message;
		
		return null;
	}
432427
protected EventLoggerEventHandler getEventHandler(ActivitiEvent event) {

		Class<? extends EventLoggerEventHandler> eventHandlerClass = null;
		if (event.getType().equals(ActivitiEventType.ENTITY_INITIALIZED)) {
			Object entity = ((ActivitiEntityEvent) event).getEntity();
			if (entity instanceof ExecutionEntity) {
				ExecutionEntity executionEntity = (ExecutionEntity) entity;
				if (executionEntity.getProcessInstanceId().equals(executionEntity.getId())) {
					eventHandlerClass = ProcessInstanceStartedEventHandler.class;
				}
			}
		} else if (event.getType().equals(ActivitiEventType.ENTITY_DELETED)) {
			Object entity = ((ActivitiEntityEvent) event).getEntity();
			if (entity instanceof ExecutionEntity) {
				ExecutionEntity executionEntity = (ExecutionEntity) entity;
				if (executionEntity.getProcessInstanceId().equals(executionEntity.getId())) {
					eventHandlerClass = ProcessInstanceEndedEventHandler.class;
				}
			}
		} else {
			// Default: dedicated mapper for the type
			eventHandlerClass = eventHandlers.get(event.getType());
		}
		
		if (eventHandlerClass != null) {
			return instantiateEventHandler(event, eventHandlerClass);
		}
		
		return null;
	}
1049857
function LogEvent(timestamp, level, messageTemplate, properties, error) {
        this.timestamp = timestamp;
        this.level = level;
        this.messageTemplate = messageTemplate;
        this.properties = properties || {};
        this.error = error || null;
    }
530831
public static XLogInfo createLogInfo(XLog log, XEventClassifier classifier) {
		/*
		 * Get the possible info cached by the log.
		 */
		XLogInfo info = log.getInfo(classifier);
		if (info == null) {
			/*
			 * Info not cached. Create it.
			 */
			info = XLogInfoImpl.create(log, classifier);
			/*
			 * Cache it.
			 */
			log.setInfo(classifier, info);
		}
		return info;
	}
249968
@SuppressWarnings("unchecked")
  public <L, E> EventLog<L, E> getOrCreateEventLog(Class<?> type, String name, Function<EventLog<L, E>, L> listenerFactory) {
    return eventRegistries.computeIfAbsent(type, t -> new ConcurrentHashMap<>())
        .computeIfAbsent(name, n -> new EventLog<>(listenerFactory));
  }
266874
static SimpleLogEvent error(Logger logger, RuntimeException error, LogData data) {
    return new SimpleLogEvent(logger, error, data);
  }
166869
@Override
    public PipelineEventReader<XMLEventReader, XMLEvent> getEventReader(
            HttpServletRequest request, HttpServletResponse response) {
        // Get the reader from the parent and add the attribute incorporating wrapper
        final PipelineEventReader<XMLEventReader, XMLEvent> cachingEventReader =
                this.wrappedComponent.getEventReader(request, response);
        final XMLEventReader eventReader =
                new AttributeIncorporatingXMLEventReader(
                        request, response, cachingEventReader.getEventReader());

        final Map<String, String> outputProperties = cachingEventReader.getOutputProperties();
        return new PipelineEventReaderImpl<XMLEventReader, XMLEvent>(eventReader, outputProperties);
    }
338103
@Override
	public LogEvent rewrite(LogEvent source) {
		// get the markers for the log event. If no markers, nothing can be
		// tagged confidential and we can return
		Marker sourceMarker = source.getMarker();
		if (sourceMarker == null) {
			return source;
		}

		// get the message. If no message we can return
		final Message msg = source.getMessage();
		if (msg == null || !(msg instanceof ParameterizedMessage)) {
			return source;
		}

		// get the parameters. If no params we can return
		Object[] params = msg.getParameters();
		if (params == null || params.length == 0) {
			return source;
		}

		// check if this event is actually marked as confidential. If not,
		// return
		Log4jMarker eventMarker = new Log4jMarker(sourceMarker);
		if (!eventMarker.contains(SecurityMarkers.CONFIDENTIAL)) {
			return source;
		}

		// we have a message, parameters, a marker, and it is confidential.
		// Process
		for (int i = 0; i < params.length; i++) {
			params[i] = MASKED_PASSWORD;
		}

		// create new message
		Message outMessage = new ParameterizedMessage(msg.getFormat(), params,
				msg.getThrowable());

		// build new log event for output
		LogEvent output = new Log4jLogEvent.Builder(source)
				.setMessage(outMessage).build();

		return output;
	}
452423
@SuppressWarnings("unchecked")
  public <L, E> EventLog<L, E> getEventLog(Class<?> type, String name) {
    return eventRegistries.computeIfAbsent(type, t -> new ConcurrentHashMap<>()).get(name);
  }
374815
@Override
	protected void append( LoggingEvent event) {

		// Render the event according to layout
		String formattedEvent = layout.format( event);

		// Append stack trace if present and layout does not handle it
		if (layout.ignoresThrowable()) {
			String[] stack = event.getThrowableStrRep();
			if (stack != null)
			{
				int len = stack.length;
				formattedEvent += ", ";
				for(int i = 0; i < len; i++)
				{
					formattedEvent += stack[i];
					if(i < len - 1)
						formattedEvent += "\u2028";
				}
			}
		}
				
		// Prepare to be queued
		this.le_async.addLineToQueue(formattedEvent);
	}
1022828
function createEventLogger( event_type, db_connection, custom_logger ) {
  var logger = custom_logger || console;

  if ( !messages[ event_type ] ) {
    throw new Error(
      'message type [ %type ] not supported'
        .replace( '%type', event_type )
    )
  }

  /**
   * @returns {undefined}
   */
  function logEvent() {
    if ( event_type === 'error' ) {
      logger.error(
        messages[ event_type ]
          .replace( '%date', new Date() )
          .replace( '%host', db_connection.host )
          .replace( '%port', db_connection.port )
          .replace( '%database', db_connection.name )
      )

      return
    }

    logger.log(
      messages[ event_type ]
        .replace( '%date', new Date() )
        .replace( '%host', db_connection.host )
        .replace( '%port', db_connection.port )
        .replace( '%database', db_connection.name )
    )
  }

  return logEvent
}
226663
private LoggingEvent appendStackTraceToEvent(final LoggingEvent event) {
    String message = event.getMessage().toString();
    // If there is a stack trace available, print it out
    if (event.getThrowableInformation() != null) {
      final String[] s = event.getThrowableStrRep();
      for (final String line : s) {
        message += "\n" + line;
      }
    }
    message = message
        .replace("\\", "\\\\")
        .replace("\n", "\\n")
        .replace("\"", "\\\"")
        .replace("\t", "\\t");

    final Throwable throwable = event.getThrowableInformation() == null ? null
        : event.getThrowableInformation().getThrowable();
    return new LoggingEvent(event.getFQNOfLoggerClass(),
        event.getLogger(),
        event.getTimeStamp(),
        event.getLevel(),
        message,
        throwable);
  }
1084280
public function doAppend(\n2n\log4php\logging\LoggingEvent $event) {
		if($this->closed) {
			return;
		}
		
		if(!$this->isAsSevereAsThreshold($event->getLevel())) {
			return;
		}

		$filter = $this->getFirstFilter();
		while($filter !== null) {
			switch ($filter->decide($event)) {
				case \n2n\log4php\LoggerFilter::DENY: return;
				case \n2n\log4php\LoggerFilter::ACCEPT: return $this->append($event);
				case \n2n\log4php\LoggerFilter::NEUTRAL: $filter = $filter->getNext();
			}
		}
		$this->append($event);
	}
1330133
@Override
    protected LogHandler createLogHandler(ServletConfig pServletConfig, boolean pDebug) {
        // If there is a bundle context available, set up a tracker for tracking the logging
        // service
        BundleContext ctx = getBundleContext(pServletConfig);
        if (ctx != null) {
            // Track logging service
            logTracker = new ServiceTracker(ctx, LogService.class.getName(), null);
            logTracker.open();
            return new ActivatorLogHandler(logTracker,pDebug);
        } else {
            // Use default log handler
            return super.createLogHandler(pServletConfig, pDebug);
        }
    }