Uninote
Uninote
用户根目录
每日点滴

<!DOCTYPE html> <html><head><meta http-equiv='Content-Type' content='text/html; charset=utf8'><title>log viewer</title> <script> var g_resRoot = '../../__res/'; var g_json_outline = '{"children":[{"children":[],"level":1,"lvNumber":"1","text":"接口:"},{"children":[],"level":1,"lvNumber":"2","text":"高亮关键字"},{"children":[],"level":1,"lvNumber":"3","text":"问题"},{"children":[],"level":1,"lvNumber":"4","text":"2018-6-26 todo"},{"children":[],"level":1,"lvNumber":"5","text":"2018-8-24 todo"},{"children":[],"level":1,"lvNumber":"6","text":"config 备份"}],"level":0,"lvNumber":"","text":"log viewer"}'; </script> <link rel='stylesheet' type='text/css' href='../../__res/common.css'><style>.s0{color:#0000ff;} .s1{color:#000000;} .s2{color:#7f01f5;} .s3{color:#000000;} .s4{color:#7f01f5;} .s5{color:#c80000;} .s6{color:#000000;} .s7{color:#7f01f5;} .s8{color:#000000;} .s9{color:#0000ff;} </style> </head><body> <script src='../../__res/util.js'></script><div id='outline'> <li><a href='#ol_0' style='font-weight:bold; font-size:22px'>log viewer</a></li> <li> <a href='#ol_1' >接口:</a></li> <li> <a href='#ol_2' >高亮关键字</a></li> <li> <a href='#ol_3' >问题</a></li> <li> <a href='#ol_4' >2018-6-26 todo</a></li> <li> <a href='#ol_5' >2018-8-24 todo</a></li> <li> <a href='#ol_6' >config 备份</a></li> </div>

<pre id='ol_0' class='title'>log viewer</pre> <pre><d class='s0'><a href='http://a.add.my/logviewer/'>http://a.add.my/logviewer/</a></d></pre> <pre><d class='s1'><a href='http://dev.rongyipiao.com:82/log.viewer/'>http://dev.rongyipiao.com:82/log.viewer/</a></d></pre> <pre><d class='s1'><a href='http://on.rongyipiao.com:82/log.viewer/'>http://on.rongyipiao.com:82/log.viewer/</a></d></pre> <pre><d class='s0'></d></pre> <pre><d class='s1'>〖E:\uninote\additional_item\logviewer〗</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s2'>obsolete:<a href='log_ana.html'>log parser/ana </a></d><d class='s3'></d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'><a href='http://a.myres.my/log.viewer/'>http://a.myres.my/log.viewer/</a></d></pre> <pre><d class='s1'>〖E:\uninote\mynote_res\logviewer〗</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'>1 文件列表(复选框)</d></pre> <pre><d class='s1'>a.log</d></pre> <pre><d class='s1'>b.log</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'>2 确定后,定时(可配置)发送请求</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'></d></pre> <h2 id='ol_1'>接口:</h2> <pre><d class='s1'>index.php/op=getContent?files=1/a.log;2/b.log</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'>返回格式:</d></pre> <pre><d class='s1'>a.log</d></pre> <pre><d class='s1'>.....</d></pre> <pre><d class='s1'><---------------------------------------></d></pre> <pre><d class='s1'>b.log</d></pre> <pre><d class='s1'>....</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'>session["last_files"]["a.log"] = 5000;</d></pre> <pre><d class='s1'>fopen("a.log")</d></pre> <pre><d class='s1'>// int fseek ( resource $handle , int $offset [, int $whence = SEEK_SET ] )</d></pre> <pre><d class='s1'>// fread </d></pre> <pre><d class='s1'>file_get_contents(path, false, NULL, 5000)</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'>配色:</d></pre> <pre><d class='s1'>第一个文件的背景色:#111</d></pre> <pre><d class='s4'></d></pre> <h2 id='ol_2'>高亮关键字</h2> <pre><d class='s5'>正则表达式可选</d><d class='s3'></d></pre> <pre><d class='s6'></d></pre> <pre><d class='s6'>#ff8000,Admin</d></pre> <pre><d class='s6'>#ff8000,cmd]</d></pre> <pre><d class='s6'>#00ff00,reset</d></pre> <pre><d class='s6'>#00ff00,checkout</d></pre> <pre><d class='s6'>#00ff00,release</d></pre> <pre><d class='s6'>#00ff00,retry</d></pre> <pre><d class='s6'>#00ffff,begin saving</d></pre> <pre><d class='s6'>#00ffff,select|query</d></pre> <pre><d class='s6'>#00ff00,insert</d></pre> <pre><d class='s6'>#00ff00,update\s+</d></pre> <pre><d class='s3'></d></pre> <h2 id='ol_3'>问题</h2> <pre><d class='s1'>指定编码,加一列</d></pre> <pre><d class='s1'><img src='..\pic\5eef0719475fd3e1e1a156fe4e7fdf84.jpg' /></d><d class='s1'></d></pre> <pre><d class='s2'>ansi:windows下就是gbk</d></pre> <pre><d class='s2'></d></pre> <pre><d class='s2'>最多读x,从配置获取,默认500K</d></pre> <pre><d class='s2'>config.php</d></pre> <pre><d class='s2'>if (is_file("../config/local_api.php")) {</d></pre> <pre><d class='s2'> $api_arr_local = require DIR . '/local_api.php';</d></pre> <pre><d class='s2'></d></pre> <pre><d class='s2'>自动换行</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s2'>移除<br/></d></pre> <pre><d class='s2'></d></pre> <pre><d class='s2'>起始索引 支持负值(长度+索引)</d></pre> <pre><d class='s2'></d></pre> <pre><d class='s2'>file_get_contents 只要出现一次</d></pre> <pre><d class='s2'>重置读取历史:将起始索引传递给server,日志+起始*; (非)</d><d class='s7'>第一次读取</d><d class='s2'>不要区分</d></pre> <pre><d class='s2'>读取内容:日志路径</d></pre> <pre><d class='s4'>保存表单功能合并到此</d><d class='s3'></d></pre> <pre><d class='s1'></d></pre> <pre><d class='s3'>监听onchange事件,背景色提示</d></pre> <pre><d class='s3'>点击保存之后,提交到server。</d></pre> <pre><d class='s3'></d></pre> <pre><d class='s5'>每次读取的内容,可以折叠,在画圈的地方,加上折叠按钮:</d><d class='s3'></d></pre> <pre><d class='s3'><img src='..\pic\59387f713166aced5fd56ef835c02ed7.jpg' /></d><d class='s3'></d></pre> <pre><d class='s3'></d></pre> <pre><d class='s3'><img src='..\pic\46cca245621cbf58dc8a5236a1e0f6ff.jpg' /></d><d class='s3'></d></pre> <pre><d class='s3'>重置到文件末尾:每个选中的文件,已读长度==文件长度</d></pre> <pre><d class='s3'></d></pre> <h2 id='ol_4'>2018-6-26 todo</h2> <pre><d class='s1'>1、全选/取消全选</d></pre> <pre><d class='s1'>点周边也能相应<img src='..\pic\47af346ae5cd0cc69058e4e76db342ff.jpg' /></d><d class='s1'></d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'>2、针对单个文件配置:</d></pre> <pre><d class='s1'><img src='..\pic\5a581d768bafcd9061478cca3c3869ca.jpg' /></d><d class='s1'></d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'>3、正则匹配</d></pre> <pre><d class='s1'>#ff0000,/data/g</d></pre> <pre><d class='s1'>忽略大小写</d></pre> <pre><d class='s8'></d></pre> <pre><d class='s8'>4、文件不存在时忽略这个文件,不要报错</d></pre> <pre><d class='s8'></d></pre> <pre><d class='s8'>5、单个文件也可以折叠,现在是折叠所有的内容(一次读取的全部内容)</d></pre> <pre><d class='s3'></d></pre> <pre><d class='s3'>6、加列:</d></pre> <pre><d class='s3'>当前位置(位置/大小)</d></pre> <pre><d class='s3'>进度条:位置/大小作为百分比</d></pre> <pre><d class='s3'>每秒钟刷新一次</d></pre> <pre><d class='s3'></d></pre> <pre><d class='s3'>7、统一传参方式,自己手动拼接参数;do_config 优化整理</d></pre> <pre><d class='s3'></d></pre> <pre><d class='s3'>8、自动换行取消时,新取读的内容还是自动换行的</d></pre> <pre><d class='s3'></d></pre> <pre><d class='s3'>9 </d><d class='s1'>定时、增量读取</d></pre> <pre><d class='s3'></d></pre> <t id='0dbd3b5d-4b0a-4ab8-94af-163fbb42ec99'> <pre class='tnd_head'>lv1= lv2= type=todo</pre> <pre><d class='s3'>读取大小大于readsize,直到读到\n</d></pre> <pre><d class='s3'>高亮:case 可选</d></pre> </t> <pre><d class='s3'></d></pre> <t id='0d48c12d-2b8e-4fa1-9997-2178109bc707'> <pre class='tnd_head'>lv1= lv2= type=</pre> <h1 id='ol_5'>2018-8-24 todo</h1> <pre><d class='s6'>路径的配置如果是文件夹,则将其路径转加上当前日期.log,eg:</d></pre> <pre><d class='s6'>/root/logs -></d></pre> <pre><d class='s6'>/root/logs/20180824.log</d><d class='s9'></d></pre> </t> <pre><d class='s3'></d></pre> <h1 id='ol_6'>config 备份</h1> <pre><d class='s6'>mynote:</d><d class='s9'></d></pre> <pre><d class='s8'>$paths = [</d></pre> <pre><d class='s8'> '/home/www/mynote/basic/runtime/logs/.api_info.log',//接口请求信息</d></pre> <pre><d class='s8'> '/home/www/mynote/basic/runtime/logs/.curl_error.log',//curl 模块错误消息</d></pre> <pre><d class='s8'> '/home/www/mynote/basic/runtime/logs/.shell.log',//shell 执行日志</d></pre> <pre><d class='s8'> '/home/www/mynote/basic/runtime/logs/app.log',//mynote 项目错误日志</d></pre> <pre><d class='s8'> '/home/www/mynote/basic/runtime/logs/ct.txt',//ct 日志</d></pre> <pre><d class='s8'> '/usr/local/mariadb/var/mariadb.err',//mysql 错误日志</d></pre> <pre><d class='s8'> '/tmp/mysql.log',//mysql 查询日志</d></pre> <pre><d class='s8'>];</d></pre> <pre><d class='s8'></d></pre> <pre><d class='s8'>online:</d></pre> <pre><d class='s8'>$paths = [</d></pre> <pre><d class='s8'> '/home/www/mynote/basic/runtime/logs/app.log',</d></pre> <pre><d class='s8'> '/home/www/mynote/basic/runtime/logs/logs.txt',</d></pre> <pre><d class='s8'> '/home/www/wwwlogs/mynote_80.log',</d></pre> <pre><d class='s8'> '/home/www/wwwlogs/mynote_80.error.log',</d></pre> <pre><d class='s8'> '/tmp/mysql.log',</d></pre> <pre><d class='s8'> </d></pre> <pre><d class='s8'>];</d></pre> <pre><d class='s3'></d></pre> </body></html>

log_query

php_ct

点赞(0) 阅读(79) 举报
目录
标题