+ /* Parse the domain string */
+ LttngLog4j2Agent.Domain parsedDomain;
+ try {
+ parsedDomain = LttngLog4j2Agent.Domain.valueOf(domain.toUpperCase());
+ } catch (IllegalArgumentException e) {
+ LOGGER.error("Invalid domain '{}' for LttngLogAppender", domain);
+ return null;
+ }
+
+ /* Create the appender and handle the possible failures. */
+ LttngLogAppender newAppender;
+ try {
+ newAppender = new LttngLogAppender(name, parsedDomain, filter, ignoreExceptions);
+ } catch (IllegalArgumentException e) {
+ LOGGER.error("Invalid domain '{}' for LttngLogAppender", parsedDomain);
+ newAppender = null;
+ } catch (SecurityException e) {
+ LOGGER.error("Security error trying to load '{}' JNI library for LttngLogAppender", SHARED_OBJECT_NAME);
+ newAppender = null;
+ } catch (IOException e) {
+ LOGGER.error("Failed to load '{}' JNI library for LttngLogAppender", SHARED_OBJECT_NAME);
+ newAppender = null;
+ }
+
+ return newAppender;