log4j-web/src/main/java/org/apache/logging/log4j/web/appender/ServletAppender.java [48:64]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public ServletAppender build() {
            final String name = getName();
            if (name == null) {
                LOGGER.error("No name provided for ServletAppender");
            }
            final ServletContext servletContext = WebLoggerContextUtils.getServletContext();
            if (servletContext == null) {
                LOGGER.error("No servlet context is available");
                return null;
            }
            final Layout<? extends Serializable> layout = getOrCreateLayout();
            if (!(layout instanceof StringLayout)) {
                LOGGER.error("Layout must be a StringLayout to log to ServletContext");
                return null;
            }
            return new ServletAppender(name, layout, getFilter(), servletContext, isIgnoreExceptions(), logThrowables);
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



log4j-jakarta-web/src/main/java/org/apache/logging/log4j/web/appender/ServletAppender.java [48:64]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public ServletAppender build() {
            final String name = getName();
            if (name == null) {
                LOGGER.error("No name provided for ServletAppender");
            }
            final ServletContext servletContext = WebLoggerContextUtils.getServletContext();
            if (servletContext == null) {
                LOGGER.error("No servlet context is available");
                return null;
            }
            final Layout<? extends Serializable> layout = getOrCreateLayout();
            if (!(layout instanceof StringLayout)) {
                LOGGER.error("Layout must be a StringLayout to log to ServletContext");
                return null;
            }
            return new ServletAppender(name, layout, getFilter(), servletContext, isIgnoreExceptions(), logThrowables);
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



