Java 类ch.qos.logback.classic.util.LevelToSyslogSeverity 实例源码

项目:syslogappender    文件:SyslogAppender.java   
public int getSeverityForEvent(Object eventObject) {
  if (eventObject instanceof ILoggingEvent) {
    ILoggingEvent event = (ILoggingEvent) eventObject;
    return LevelToSyslogSeverity.convert(event);
  } else {
    return Level.INFO_INT;
  }
}
项目:logback-gelf    文件:GelfLayout.java   
@Override
public String doLayout(final ILoggingEvent event) {
    final String shortMessage = shortPatternLayout.doLayout(event);
    final String fullMessage = fullPatternLayout.doLayout(event);
    final double timestamp = event.getTimeStamp() / MSEC_DIVIDER;
    final Map<String, Object> additionalFields = mapAdditionalFields(event);

    final GelfMessage gelfMessage =
        new GelfMessage(originHost, shortMessage, fullMessage, timestamp,
            LevelToSyslogSeverity.convert(event), additionalFields);

    final String jsonStr = gelfMessage.toJSON();
    return appendNewline ? jsonStr + System.lineSeparator() : jsonStr;
}
项目:bartleby    文件:SyslogStartConverter.java   
public String convert(ILoggingEvent event) {
  StringBuilder sb = new StringBuilder();

  int pri = facility + LevelToSyslogSeverity.convert(event);

  sb.append("<");
  sb.append(pri);
  sb.append(">");
  sb.append(computeTimeStampString(event.getTimeStamp()));
  sb.append(' ');
  sb.append(localHostName);
  sb.append(' ');

  return sb.toString();
}
项目:logback-syslog4j    文件:Syslog4jAppender.java   
/**
 * Convert a level to equivalent syslog severity. Only levels for printing
 * methods i.e DEBUG, WARN, INFO and ERROR are converted.
 *
 * @see ch.qos.logback.core.net.SyslogAppenderBase#getSeverityForEvent(java.lang.Object)
 */
public int getSeverityForEvent(Object eventObject) {
    if (eventObject instanceof ILoggingEvent) {
        ILoggingEvent event = (ILoggingEvent) eventObject;
        return LevelToSyslogSeverity.convert(event);
    } else {
        return SyslogIF.LEVEL_INFO;
    }
}
项目:BikeMan    文件:MillisecondPrecisionSyslogStartConverter.java   
public String convert(final ILoggingEvent event) {
    final StringBuilder sb = new StringBuilder();

    final int pri = facility + LevelToSyslogSeverity.convert(event);

    sb.append("<");
    sb.append(pri);
    sb.append(">");
    computeTimeStampString(sb, event.getTimeStamp());
    sb.append(' ');
    sb.append(localHostName);
    sb.append(' ');

    return sb.toString();
}
项目:logging-java    文件:MillisecondPrecisionSyslogStartConverter.java   
public String convert(final ILoggingEvent event) {
  final StringBuilder sb = new StringBuilder();

  final int pri = facility + LevelToSyslogSeverity.convert(event);

  sb.append("<");
  sb.append(pri);
  sb.append(">");
  sb.append(computeTimeStampString(event.getTimeStamp()));
  sb.append(' ');
  sb.append(localHostName);
  sb.append(' ');

  return sb.toString();
}
项目:bartleby    文件:SyslogAppender.java   
/**
 * Convert a level to equivalent syslog severity. Only levels for printing
 * methods i.e DEBUG, WARN, INFO and ERROR are converted.
 *
 * @see ch.qos.logback.core.net.SyslogAppenderBase#getSeverityForEvent(java.lang.Object)
 */
@Override
public int getSeverityForEvent(Object eventObject) {
  ILoggingEvent event = (ILoggingEvent) eventObject;
  return LevelToSyslogSeverity.convert(event);
}