神策数据上报操作
神策数据上报要打开两个命令行窗口,一个执行控制台程序,一个查看文件日志。
执行控制台程序操作如下:
先开启docker,开启容器,进入容器,打开nginx和PHP查看开启状态,之后
再执行如下操作
root@19e34d1ebb64:/var/www/work/console# ./yii shirley/test(这里填测试的文件名)
array(8) {
["$app_version"]=>
string(7) "3.3.5.1"
["$model"]=>
string(10) "vivo X710L"
["$os"]=>
string(7) "android"
["$device_id"]=>
string(15) "864855024939201"
["$time"]=>
int(1526028370146)
["$ip"]=>
string(14) "183.14.135.160"
["package_name"]=>
string(12) "cn.qlwb.qlwb"
["channel"]=>
string(8) "qlwb_czk"
}
另一个窗口的操作如下:
进入容器之后显示日志文件测试结果
C:\Users\Administrator>docker exec -it backend0512 /bin/bash(进入这个容器)
root@19e34d1ebb64:/#
root@19e34d1ebb64:/# ls
bin data etc lib media opt root sbin sys usr
boot dev home lib64 mnt proc run srv tmp var
root@19e34d1ebb64:/# cd /data/sa
root@19e34d1ebb64:/data/sa# ls
service.log.2018-05-11
root@19e34d1ebb64:/data/sa# tail -f service.log.2018-05-11
{"type":"track","properties":{"$lib":"php","$lib_version":"1.7.2","$app_version":"3.3.5.1","$model":"vivo X710L","$os":"android","$device_id":"864855024939201","$ip":"183.14.135.160","user_uid_v2":"900000","user_level_v3":35,"user_age":23,"user_sex_v2":"0","room_id":"110003","$is_login_id":true},"time":1526028092089,"distinct_id":"900000","lib":{"$lib":"php","$lib_version":"1.7.2","$lib_method":"code","$lib_detail":"common\\dao\\sensorsanaly\\SensorsAnalyticsDAO##track##\/var\/www\/work\/console\/common\/dao\/sensorsanaly\/SensorsAnalyticsDAO.php##53"},"project":"testqinglv","event":"OpenVoiceRoom"}
{"type":"track","properties":{"$lib":"php","$lib_version":"1.7.2","$app_version":"3.3.5.1","$model":"vivo X710L","$os":"android","$device_id":"864855024939201","$ip":"183.14.135.160","user_uid_v2":"900000","user_level_v3":35,"user_age":23,"user_sex_v2":"0","room_id":"110003","$is_login_id":true},"time":1526028160202,"distinct_id":"900000","lib":{"$lib":"php","$lib_version":"1.7.2","$lib_method":"code","$lib_detail":"common\\dao\\sensorsanaly\\SensorsAnalyticsDAO##track##\/var\/www\/work\/console\/common\/dao\/sensorsanaly\/SensorsAnalyticsDAO.php##53"},"project":"testqinglv","event":"OpenVoiceRoom"}
{"type":"track","properties":{"$lib":"php","$lib_version":"1.7.2","$app_version":"3.3.5.1","$model":"vivo X710L","$os":"android","$device_id":"864855024939201","$ip":"183.14.135.160","user_uid_v2":"900000","user_level_v3":35,"user_age":23,"user_sex_v2":"0","room_id":"110003","$is_login_id":true},"time":1526028175058,"distinct_id":"900000","lib":{"$lib":"php","$lib_version":"1.7.2","$lib_method":"code","$lib_detail":"common\\dao\\sensorsanaly\\SensorsAnalyticsDAO##track##\/var\/www\/work\/console\/common\/dao\/sensorsanaly\/SensorsAnalyticsDAO.php##53"},"project":"testqinglv","event":"OpenVoiceRoom"}