当前位置: 首页>>代码示例>>Java>>正文


Java SyslogConstants.LEVEL_NOTICE属性代码示例

本文整理汇总了Java中org.productivity.java.syslog4j.SyslogConstants.LEVEL_NOTICE属性的典型用法代码示例。如果您正苦于以下问题:Java SyslogConstants.LEVEL_NOTICE属性的具体用法?Java SyslogConstants.LEVEL_NOTICE怎么用?Java SyslogConstants.LEVEL_NOTICE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.productivity.java.syslog4j.SyslogConstants的用法示例。


在下文中一共展示了SyslogConstants.LEVEL_NOTICE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLevelString

public static final String getLevelString(int level) {
	switch(level) {
		case SyslogConstants.LEVEL_DEBUG: return "DEBUG";
		case SyslogConstants.LEVEL_INFO: return "INFO";
		case SyslogConstants.LEVEL_NOTICE: return "NOTICE";
		case SyslogConstants.LEVEL_WARN: return "WARN";
		case SyslogConstants.LEVEL_ERROR: return "ERROR";
		case SyslogConstants.LEVEL_CRITICAL: return "CRITICAL";
		case SyslogConstants.LEVEL_ALERT: return "ALERT";
		case SyslogConstants.LEVEL_EMERGENCY: return "EMERGENCY";
		
		default:
			return "UNKNOWN";
	}
}
 
开发者ID:syslog4j,项目名称:syslog4j,代码行数:15,代码来源:SyslogUtility.java

示例2: getLog4jLevel

protected static Level getLog4jLevel(int level) {
	switch(level) {
		case SyslogConstants.LEVEL_DEBUG: 		return Level.DEBUG;
		case SyslogConstants.LEVEL_INFO: 		return Level.INFO;
		case SyslogConstants.LEVEL_NOTICE: 		return Level.INFO;
		case SyslogConstants.LEVEL_WARN: 		return Level.WARN;
		case SyslogConstants.LEVEL_ERROR: 		return Level.ERROR;
		case SyslogConstants.LEVEL_CRITICAL: 	return Level.ERROR;
		case SyslogConstants.LEVEL_ALERT: 		return Level.ERROR;
		case SyslogConstants.LEVEL_EMERGENCY: 	return Level.FATAL;
		
		default:
			return Level.WARN;
	}
}
 
开发者ID:syslog4j,项目名称:syslog4j,代码行数:15,代码来源:Log4jSyslogBackLogHandler.java

示例3: log

public void log(int level, String message) {
	if (SyslogConstants.LEVEL_DEBUG == level) { debug(message); }
	if (SyslogConstants.LEVEL_INFO == level) { info(message); }
	if (SyslogConstants.LEVEL_NOTICE == level) { notice(message); }
	if (SyslogConstants.LEVEL_WARN == level) { warn(message); }
	if (SyslogConstants.LEVEL_ERROR == level) { error(message); }
	if (SyslogConstants.LEVEL_CRITICAL == level) { critical(message); }
	if (SyslogConstants.LEVEL_ALERT == level) { alert(message); }
	if (SyslogConstants.LEVEL_EMERGENCY == level) { emergency(message); }
}
 
开发者ID:syslog4j,项目名称:syslog4j,代码行数:10,代码来源:MultipleSyslogCreateTest.java

示例4: sendMessage

static public void sendMessage(SyslogIF syslog, int priority,String message, 
		boolean addTimestamp, String pattern,
		boolean addHostName) {
	
	String messageString =message;
	
	// Do we need to add hostname?
	if(addHostName) {
		messageString= Const.getHostname() + " " +messageString;
	}
	
	// Do we need to add timestamp
	if(addTimestamp) {
		SimpleDateFormat dateFormat = new SimpleDateFormat (pattern);
		dateFormat.setTimeZone(TimeZone.getDefault());
		messageString = dateFormat.format( Calendar.getInstance().getTime() ) + " : " + messageString;
	}

	// send message
	switch(priority) {
		case SyslogConstants.LEVEL_EMERGENCY  : syslog.emergency(messageString); break;
		case SyslogConstants.LEVEL_ALERT : syslog.alert(messageString); break;
		case SyslogConstants.LEVEL_CRITICAL : syslog.critical(messageString); break;
		case SyslogConstants.LEVEL_ERROR : syslog.error(messageString); break;
		case SyslogConstants.LEVEL_WARN : syslog.warn(messageString); break;
		case SyslogConstants.LEVEL_NOTICE : syslog.notice(messageString); break;
		case SyslogConstants.LEVEL_INFO : syslog.info(messageString); break;
		case SyslogConstants.LEVEL_DEBUG : syslog.debug(messageString); break;
		default: break;
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:31,代码来源:SyslogDefs.java

示例5: determineLogLevel

private int determineLogLevel(final OnmsSeverity severity) {
	int level;
	switch (severity) {
	case CRITICAL:
		level = SyslogConstants.LEVEL_CRITICAL;
		break;
	case MAJOR:
		level = SyslogConstants.LEVEL_ERROR;
		break;
	case MINOR:
		level = SyslogConstants.LEVEL_ERROR;
		break;
	case WARNING:
		level = SyslogConstants.LEVEL_WARN;
	case NORMAL:
		level = SyslogConstants.LEVEL_NOTICE;
		break;
	case CLEARED:
		level = SyslogConstants.LEVEL_INFO;
		break;
	case INDETERMINATE:
		level = SyslogConstants.LEVEL_DEBUG;
		break;
	default:
		level = SyslogConstants.LEVEL_WARN;
	}
	return level;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:28,代码来源:SyslogNorthbounder.java

示例6: sendMessage

public static void sendMessage( SyslogIF syslog, int priority, String message, boolean addTimestamp,
  String pattern, boolean addHostName ) {

  String messageString = message;

  // Do we need to add hostname?
  if ( addHostName ) {
    messageString = Const.getHostname() + " " + messageString;
  }

  // Do we need to add timestamp
  if ( addTimestamp ) {
    SimpleDateFormat dateFormat = new SimpleDateFormat( pattern );
    dateFormat.setTimeZone( TimeZone.getDefault() );
    messageString = dateFormat.format( Calendar.getInstance().getTime() ) + " : " + messageString;
  }

  // send message
  switch ( priority ) {
    case SyslogConstants.LEVEL_EMERGENCY:
      syslog.emergency( messageString );
      break;
    case SyslogConstants.LEVEL_ALERT:
      syslog.alert( messageString );
      break;
    case SyslogConstants.LEVEL_CRITICAL:
      syslog.critical( messageString );
      break;
    case SyslogConstants.LEVEL_ERROR:
      syslog.error( messageString );
      break;
    case SyslogConstants.LEVEL_WARN:
      syslog.warn( messageString );
      break;
    case SyslogConstants.LEVEL_NOTICE:
      syslog.notice( messageString );
      break;
    case SyslogConstants.LEVEL_INFO:
      syslog.info( messageString );
      break;
    case SyslogConstants.LEVEL_DEBUG:
      syslog.debug( messageString );
      break;
    default:
      break;
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:47,代码来源:SyslogDefs.java


注:本文中的org.productivity.java.syslog4j.SyslogConstants.LEVEL_NOTICE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。