docker運行badjs

pull鏡像

docker pull docker.io/caihuijigood/badjs-docker

建立mysql數據庫

badjs-web/db/create.sqlhtml

建立mongo

use badjsmysql

啓動

docker run -i -d -p 8080:80 -p 8081:8081 docker.io/caihuijigood/badjs-docker bash badjs mysql=mysql://root:root@192.168.99.100:3306/badjs mongodb=mongodb://192.168.99.100:27017/badjs

上報

獲取項目id,好比id=1git

git clone https://github.com/BetterJS/badjs-report.git

修改example/index.html的配置,好比github

BJ_REPORT.init({
             id: 1,
             url: "http://192.168.99.100:8080/badjs",
         }).tryJs().spyAll();

修改src/bj-report.js,好比web

var _config = {
        id: 1, // 上報 id
        uin: 0, // user id
        url: "http://192.168.99.100:8080/badjs", // 上報 接口
        combo: 1, // 是否合併 !0-合併 0-不合並
        ext: null, // 擴展參數 用於自定義上報
        level: 4, // 錯誤級別 1-debug 2-info 4-error
        ignore: [], // 忽略某個錯誤, 支持 Regexp 和 Function
        random: 1, // 抽樣 (0-1] 1-全量
        delay: 1000, // 延遲上報 combo 爲 true 時有效
        submit: null, // 自定義上報方式
        repeat: 5 // 重複上報次數(對於同一個錯誤超過多少次不上報)
    };

而後雙擊example/index.html
而後去8081後臺,查看日誌
http://192.168.99.100:8081/us...
圖片描述sql

doc

相關文章
相關標籤/搜索