当前位置:网站首页>EasyCVR平台路由日志功能的技术实现过程【附代码】
EasyCVR平台路由日志功能的技术实现过程【附代码】
2022-06-27 20:20:00 【EasyCVR】
EasyCVR支持海量视频汇聚管理,可提供视频监控直播、云端录像、云存储、录像检索与回看、智能告警、平台级联、智能分析等视频服务。平台兼容性强、开放度高,具有强大的数据接入、处理及分发能力,目前已经应用在智慧工地、智慧校园、智慧社区、智慧楼宇、智慧安防等场景中。

近期我们对EasyCVR添加了路由日志功能,今天和大家分享一下实现过程。
在项目应用中,有用户需要记录每个接口调用的具体IP和url路径参数,因此我们在EasyCVR平台中加入了路由日志功能。


添加如下代码,在路由接口初始化时,可定义自定义log日志中间件,然后根据想要的格式,从请求的头信息中找到需要的ip和url参数。

func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
formatter := conf.Formatter
if formatter == nil {
formatter = defaultLogFormatter
}
out := conf.Output
if out == nil {
out = DefaultWriter
}
notlogged := conf.SkipPaths
isTerm := true
if w, ok := out.(*os.File); !ok || os.Getenv("TERM") == "dumb" ||
(!isatty.IsTerminal(w.Fd()) && !isatty.IsCygwinTerminal(w.Fd())) {
isTerm = false
}
再次请求页面接口,接口日志已经可以正常打印。


EasyCVR视频融合云平台不仅支持多类型设备、多协议接入,在网络环境部署上也较为灵活,支持4G/5G、WiFi、宽带等网络接入,极大满足用户在多样化场景中的使用需求。平台在线下场景中应用广泛,包括智慧工地、智慧工厂、智慧校园、智慧社区等等。

同时,我们也提供了丰富的API接口供用户调用、集成与二次开发,近期我们正在对EasyCVR平台进行新功能的拓展,欢迎大家关注我们的更新。
边栏推荐
- [essay]me53n add button to call URL
- 这类人开始被VC疯抢,月薪8万
- 使用同花顺手机炒股安全吗?
- 这届考生,报志愿比高考更“拼命”
- Penetration learning - shooting range chapter - detailed introduction to Pikachu shooting range (under continuous update - currently only the SQL injection part is updated)
- PHP connects to database to realize user registration and login function
- How to participate in openharmony code contribution
- 跟着存档教程动手学RNAseq分析(三):使用DESeq2进行计数标准化
- 《7天學會Go並發編程》第7天 go語言並發編程Atomic原子實戰操作含ABA問題
- SQL Server 2016详细安装教程(附注册码和资源)
猜你喜欢
随机推荐
MySQL十八:写语句的执行过程
[network] common request methods
Summary of various loams (laser SLAM)
[microservices] (16) -- distributed transaction Seata
官宣!Apache Doris 从 Apache 孵化器毕业,正式成为 Apache 顶级项目!
Design of STM32 and rc522 simple bus card system
凌云出海记 | 沐融科技&华为云:打造非洲金融SaaS解决方案样板
Crawler notes (2) - parse
Advertising is too "wild", Yoshino "surrenders"
【经典干货书】数据科学中的信息理论方法,561页pdf
2022年第一季度“广州好人”刘磊峰:具有强烈的诚信意识和食品安全意识
月薪3万的狗德培训,是不是一门好生意?
Fsnotify interface of go language to monitor file modification
Livox Lidar+海康Camera实时生成彩色点云
基于 ESXi 的黑群晖 DSM 7.0.1 安装 VMware Tools
[js]var, let,const 的区别
ABAP essay-excel-3-batch import (breaking through 9999 lines of standard functions)
About the SQL injection of davwa, errors are reported: analysis and verification of the causes of legal mix of settlements for operation 'Union'
[electron] 基础学习
Bibliothèque d'exploitation / de développement locale open source pour l'outil de dessin en ligne hiplot









