本文整理汇总了Java中org.apache.mina.filter.logging.LoggingFilter.setSessionCreatedLogLevel方法的典型用法代码示例。如果您正苦于以下问题:Java LoggingFilter.setSessionCreatedLogLevel方法的具体用法?Java LoggingFilter.setSessionCreatedLogLevel怎么用?Java LoggingFilter.setSessionCreatedLogLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.mina.filter.logging.LoggingFilter
的用法示例。
在下文中一共展示了LoggingFilter.setSessionCreatedLogLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.apache.mina.filter.logging.LoggingFilter; //导入方法依赖的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();
}
}
示例2: getFilter
import org.apache.mina.filter.logging.LoggingFilter; //导入方法依赖的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;
}