本文整理汇总了Java中org.apache.mina.filter.logging.LogLevel类的典型用法代码示例。如果您正苦于以下问题:Java LogLevel类的具体用法?Java LogLevel怎么用?Java LogLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogLevel类属于org.apache.mina.filter.logging包,在下文中一共展示了LogLevel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: log
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
protected void log ( final LogLevel level, final String message, final Object... args )
{
switch ( level )
{
case DEBUG:
this.logger.debug ( message, args );
break;
case INFO:
this.logger.info ( message, args );
break;
case WARN:
this.logger.warn ( message, args );
break;
case ERROR:
this.logger.error ( message, args );
break;
case TRACE:
this.logger.trace ( message, args );
break;
default:
break;
}
}
示例2: log
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Log if the logger and the current event log level are compatible. We log
* a message and an exception.
*
* @param eventLevel the event log level as requested by the user
* @param message the message to log
* @param cause the exception cause to log
*/
private void log(LogLevel eventLevel, String message, Throwable cause) {
switch (eventLevel) {
case TRACE:
logger.trace(message, cause);
return;
case DEBUG:
logger.debug(message, cause);
return;
case INFO:
logger.info(message, cause);
return;
case WARN:
logger.warn(message, cause);
return;
case ERROR:
logger.error(message, cause);
return;
default:
return;
}
}
示例3: start
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
public void start()
{
mAcceptor = new NioSocketAcceptor();
LoggingFilter loggingFilter = new LoggingFilter();
loggingFilter.setSessionClosedLogLevel(LogLevel.NONE);
loggingFilter.setSessionCreatedLogLevel(LogLevel.NONE);
loggingFilter.setSessionOpenedLogLevel(LogLevel.NONE);
loggingFilter.setMessageSentLogLevel(LogLevel.NONE);
mAcceptor.getFilterChain().addLast("logger", loggingFilter);
mAcceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new MinaCodec.Encoder(), new MinaCodec.Decoder()));
mAcceptor.getSessionConfig().setReadBufferSize(4096);
// macceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 10);
mServerHandler = new MinaServerHandler();
mAcceptor.setHandler(mServerHandler);
try {
mAcceptor.bind(new InetSocketAddress(ServerConfig.NET_TCP_IP, ServerConfig.NET_TCP_PORT));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例4: log
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Copied by parent
*/
private void log(LogLevel eventLevel, String message, Object param) {
switch (eventLevel) {
case TRACE:
log.trace(message, param);
return;
case DEBUG:
log.debug(message, param);
return;
case INFO:
log.info(message, param);
return;
case WARN:
log.warn(message, param);
return;
case ERROR:
log.error(message, param);
return;
default:
return;
}
}
示例5: getFilter
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
public static LoggingFilter getFilter()
{
LoggingFilter filter = new LoggingFilter();
filter.setSessionCreatedLogLevel(LogLevel.NONE);
filter.setSessionOpenedLogLevel(LogLevel.NONE);
filter.setMessageReceivedLogLevel(LogLevel.NONE);
filter.setSessionIdleLogLevel(LogLevel.NONE);
filter.setSessionClosedLogLevel(LogLevel.NONE);
filter.setMessageSentLogLevel(LogLevel.NONE);
return filter;
}
示例6: setExceptionCaughtLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Set the LogLevel for the ExceptionCaught event.
*
* @param level The LogLevel to set
*/
public void setExceptionCaughtLogLevel(LogLevel level) {
exceptionCaughtLevel = level;
}
示例7: getExceptionCaughtLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Get the LogLevel for the ExceptionCaught event.
*
* @return The LogLevel for the ExceptionCaught eventType
*/
public LogLevel getExceptionCaughtLogLevel() {
return exceptionCaughtLevel;
}
示例8: setMessageReceivedLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Set the LogLevel for the MessageReceived event.
*
* @param level The LogLevel to set
*/
public void setMessageReceivedLogLevel(LogLevel level) {
messageReceivedLevel = level;
}
示例9: getMessageReceivedLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Get the LogLevel for the MessageReceived event.
*
* @return The LogLevel for the MessageReceived eventType
*/
public LogLevel getMessageReceivedLogLevel() {
return messageReceivedLevel;
}
示例10: setMessageSentLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Set the LogLevel for the MessageSent event.
*
* @param level The LogLevel to set
*/
public void setMessageSentLogLevel(LogLevel level) {
messageSentLevel = level;
}
示例11: getMessageSentLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Get the LogLevel for the MessageSent event.
*
* @return The LogLevel for the MessageSent eventType
*/
public LogLevel getMessageSentLogLevel() {
return messageSentLevel;
}
示例12: setSessionCreatedLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Set the LogLevel for the SessionCreated event.
*
* @param level The LogLevel to set
*/
public void setSessionCreatedLogLevel(LogLevel level) {
sessionCreatedLevel = level;
}
示例13: getSessionCreatedLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Get the LogLevel for the SessionCreated event.
*
* @return The LogLevel for the SessionCreated eventType
*/
public LogLevel getSessionCreatedLogLevel() {
return sessionCreatedLevel;
}
示例14: setSessionOpenedLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Set the LogLevel for the SessionOpened event.
*
* @param level The LogLevel to set
*/
public void setSessionOpenedLogLevel(LogLevel level) {
sessionOpenedLevel = level;
}
示例15: getSessionOpenedLogLevel
import org.apache.mina.filter.logging.LogLevel; //导入依赖的package包/类
/**
* Get the LogLevel for the SessionOpened event.
*
* @return The LogLevel for the SessionOpened eventType
*/
public LogLevel getSessionOpenedLogLevel() {
return sessionOpenedLevel;
}