SuperSocket的日志功能非常简单,你几乎可以在任何地方都能记录日志。 AppServer 和 AppSession 都有Logger属性, 你可以直接用它来记录日志。

以下代码演示了日志接口的使用:

A -

/// <summary>

/// PolicyServer base class

/// </summary>

public abstract class PolicyServer : AppServer<PolicySession, BinaryRequestInfo>

{

......

/// <summary>

/// Setups the specified root config.

/// </summary>

/// <param name="rootConfig">The root config.</param>

/// <param name="config">The config.</param>

/// <returns></returns>

protected override bool Setup(IRootConfig rootConfig, IServerConfig config)

{

m_PolicyFile = config.Options.GetValue("policyFile");

if (string.IsNullOrEmpty(m_PolicyFile))

{

if(Logger.IsErrorEnabled)

Logger.Error("Configuration option policyFile is required!");

return false;

}

return true;

}

......

}

B -

public class RemoteProcessSession : AppSession<RemoteProcessSession>

{

protected override void HandleUnknownRequest(StringRequestInfo requestInfo)

{

Logger.Error("Unknow request");

}

}

最新文章

  1. redux的中间层 --reactjs学习
  2. cocos2dx day 2 - Sprites
  3. 上班遇到的——关于Web安全
  4. Mysql --分区表(2)
  5. Python--matplotlib绘图可视化知识点整理
  6. 桐桐的贸易--WA
  7. hadoop2.x通过Zookeeper来实现namenode的HA方案以及ResourceManager单点故障的解决方案
  8. 2dx解析cocosbuilder中使用layer时的缺陷
  9. 3.x的触摸响应机制
  10. java Spring集合
  11. 获取DOM的真实节点
  12. mac下通过docker搭建LEMP环境
  13. Spring Cache抽象详解
  14. POJThe Doors AND NYIST 有趣的问题
  15. java web.xml listener servlet 和filter加载顺序
  16. 【 js 模块加载 】深入学习模块化加载(node.js 模块源码)
  17. 模拟controfile丢失与重建
  18. UVA11853-Paintball(对偶图)
  19. android-如何获得当前正在运行的activity的相关信息
  20. .Net-using-Class:String 类

热门文章

  1. OpenSmtp 发送邮件
  2. centos搭建svn 服务器 并同步到web 目录(总结)
  3. 移动端h5禁用浏览器左滑右滑的前进后退功能
  4. Python学习笔记(二)使用Sublime Text编写简单的Python程序()
  5. 继续对dubbo源代码进行maven builder
  6. navgator 用于浏览器检测
  7. MySQL用户管理+MySQL权限管理
  8. CSS基础学习中的几大要点心得
  9. Directx11教程(42) 纹理映射(12)-简单的bump mapping
  10. iOS支付宝2.0 SDK集成整理