0
A
回答
0
发送日志服务器,例如使用jQuery:
$.post("/log/save.php",
log: "Hello world",
function(){
console.log("log saved")
}
);
然后/log/save.php
连接到数据库,并保存到记录表或保存日志文件:
<?php
$file = 'logs.txt';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new log to the file
$current .= $_POST["log"]."\n"; //hello world.
// Write the contents back to the file
file_put_contents($file, $current);
?>
相关问题
- 1. Cron输出到日志,有没有办法使日志动态?
- 2. 从服务器获取Windows日志到我的网站
- 3. java日志记录/日志服务器
- 4. 远程系统日志服务器上未收到日志
- 5. 从服务器到服务器的日志自动传输
- 6. 没有日志库的日志记录
- 7. 有没有办法在Ubuntu上保留日志(错误)?
- 8. 有没有办法将日志记录器工厂添加到日志记录器配置中?
- 9. Tomcat 6日志记录器没有收到webapp日志数据
- 10. 有没有办法从日志grep这个多行部分?
- 11. 有没有办法阻止日志消息被打印到LogCat?
- 12. 有没有办法将调试信息打印到日志中?
- 13. UnableToCompleteException没有日志
- 14. FirebaseMessagingService没有日志
- 15. Silex没有错误记录到服务器的错误日志
- 16. 有没有办法配置Log4Net将日志写入Windows服务中的BaseDirectory?
- 17. nginx发送日志到远程系统日志服务器
- 18. 有没有办法将日志流式传输到Spring Boot应用程序?
- 19. 日志ODBC,SQL服务器
- 20. grails服务器日志
- 21. Glassfish 2服务器日志
- 22. XML-RPC服务器日志
- 23. 收集日志ZIP并上传到Http服务没有临时文件
- 24. gce容器日志没有显示在云端日志记录
- 25. 上传Android的通话/短信日志到服务器
- 26. 将日志文件上传到不同的服务器:Laravel
- 27. Foxx服务日志
- 28. 有没有办法从.fsx文件直接发送HTML到FsLab日志中?
- 29. 有没有办法检查表锁定日志?
- 30. 有没有办法访问Skype即时通讯日志?
也许使用AJAX - 但为什么你想这样做? –
“javascript日志”是什么意思?我假设你知道上传数据到服务器是可能的。 –