Examples of SyslogAppender


Examples of ch.qos.logback.classic.net.SyslogAppender

        this.stackTracePrefix = stackTracePrefix;
    }

    @Override
    public Appender<ILoggingEvent> build(LoggerContext context, String applicationName, Layout<ILoggingEvent> layout) {
        final SyslogAppender appender = new SyslogAppender();
        appender.setName("syslog-appender");
        appender.setContext(context);
        appender.setSuffixPattern(logFormat.replaceAll(LOG_TOKEN_PID, PID).replaceAll(LOG_TOKEN_NAME, Matcher.quoteReplacement(applicationName)));
        appender.setSyslogHost(host);
        appender.setPort(port);
        appender.setFacility(facility.toString().toLowerCase(Locale.ENGLISH));
        appender.setThrowableExcluded(!includeStackTrace);
        appender.setStackTracePattern(stackTracePrefix);
        addThresholdFilter(appender, threshold);
        appender.start();
        return wrapAsync(appender);
    }
View Full Code Here

Examples of ch.qos.logback.classic.net.SyslogAppender

            pl.start();

            ((RollingFileAppender) appender).setEncoder(pl);

        } else if(output instanceof SyslogOutput) {
            appender = new SyslogAppender();
            ((SyslogAppender)appender).setSyslogHost(((SyslogOutput) output).getHostName());
            ((SyslogAppender)appender).setFacility(((SyslogOutput) output).getFacility());

            ((SyslogAppender) appender).setSuffixPattern(output.getPattern());
        } else {
View Full Code Here

Examples of org.apache.log4j.net.SyslogAppender

  @Test
  public void testAppend() throws InterruptedException {
    Logger logger = Logger.getLogger(getClass());
    // use the Apache syslog appender to write to syslog source
    SyslogAppender appender = new SyslogAppender(null,
        "localhost:"+TEST_SYSLOG_PORT, SyslogAppender.LOG_FTP);
    logger.addAppender(appender);
    Event e = null;
    Event e2 = null;
View Full Code Here

Examples of org.apache.log4j.net.SyslogAppender

        if (syslogHost == null || syslogHost.trim().equals("") )
        {
            return;
        }

        Appender appender = new SyslogAppender(layout, syslogHost, logLevel);
        logger.addAppender(appender);
    }
View Full Code Here

Examples of org.apache.log4j.net.SyslogAppender

            errorHandler.error(" Invalid format for the IP Addresses parameter ");
            return;
        }

        for (String syslogHost : _syslogHostsList) {
            _syslogAppenders.add(new SyslogAppender(getLayout(), syslogHost, SyslogAppender.getFacility(_facility)));
        }
    }
View Full Code Here

Examples of org.apache.log4j.net.SyslogAppender

            memoryAppender.setCircularBuffer(new CircularBuffer(200));
            memoryAppender.activateOptions();
          }

          if (appender instanceof SyslogAppender) {
            SyslogAppender syslogAppender = (SyslogAppender) appender;
            syslogAppender.setSyslogHost(appenderResource
                .getProperty(LoggingConstants.AppenderProperties.SYS_LOG_HOST));
            syslogAppender.setFacility(appenderResource
                .getProperty(LoggingConstants.AppenderProperties.FACILITY));
          }

          if (appender instanceof AppenderSkeleton) {
            AppenderSkeleton appenderSkeleton = (AppenderSkeleton) appender;
View Full Code Here

Examples of org.apache.log4j.net.SyslogAppender

                    appenderResource.addProperty(LoggingConstants.AppenderProperties.THRESHOLD, "DEBUG");
                }
            }

            if (appender instanceof SyslogAppender) {
                SyslogAppender syslogAppender = (SyslogAppender) appender;

                // if user has not set these properties system automatically assign default values
                appenderResource.addProperty(LoggingConstants.AppenderProperties.SYS_LOG_HOST,
                        syslogAppender.getSyslogHost());
                appenderResource.addProperty(LoggingConstants.AppenderProperties.FACILITY,
                        syslogAppender.getFacility());
                appenderResource.addProperty(LoggingConstants.AppenderProperties.IS_SYS_LOG_APPENDER,
                        Boolean.toString(true));
            } else {
                appenderResource.addProperty(LoggingConstants.AppenderProperties.IS_SYS_LOG_APPENDER,
                        Boolean.toString(false));
View Full Code Here

Examples of org.apache.log4j.net.SyslogAppender

                }
                ((FileAppender) appender).activateOptions();
            }

            if (appender instanceof SyslogAppender) {
                SyslogAppender syslogAppender = (SyslogAppender) appender;
                syslogAppender.setSyslogHost(sysLogHost);
                syslogAppender.setFacility(facility);
            }

            // set the threshold
            if (appender instanceof AppenderSkeleton) {
                AppenderSkeleton appenderSkeleton = (AppenderSkeleton) appender;
View Full Code Here

Examples of org.apache.log4j.net.SyslogAppender

                    appender.setThreshold(Level.toLevel(Priority.DEBUG_INT));
                    appenderData.setThreshold("DEBUG");
                }
            }
            if (targetAppender instanceof SyslogAppender) { //NOTE: Don't make this an else if
                SyslogAppender appender = (SyslogAppender) targetAppender;
                appenderData.setIsSysLogAppender(true);
                appenderData.setFacility(appender.getFacility());
                appenderData.setSysLogHost(appender.getSyslogHost());
            } else if (targetAppender instanceof FileAppender) {
                appenderData.setIsFileAppender(true);
                appenderData.setLogFile(((FileAppender) targetAppender).getFile());
            }
        }
View Full Code Here

Examples of org.apache.log4j.net.SyslogAppender

        if (syslogHost == null || syslogHost.trim().equals("") )
        {
            return;
        }

        Appender appender = new SyslogAppender(layout, syslogHost, logLevel);
        logger.addAppender(appender);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.