doujia4619 2015-10-23 06:50 采纳率: 0%
浏览 44
已采纳

将整个日志文件保存在变量中?

I need a variable to save it content in my database - the content I want are many domains logfiles on my server -- so like xyz.log

So in my path /var/www/laravel/logs/vhosts/ are all the logfiles and know I need to save them all in a variable

but I don't know how.. I'm able so save the contents of the log files in variables.. but not the name of the domains itself :/

I need something that save the content in a variable AND without the .log at the end!

Does anybody can say me how?

  • 写回答

1条回答 默认 最新

  • dongxuxian1123 2015-10-23 06:58
    关注

    Take a look at the File facade. Sounds like you want to get a list of all log files from your vhosts directory:

    $files = File::files($directory);
    

    Once you have all the files, you can do all operations you want (like getting the filename without the .log extension

    You could take a look at the docs to get a better idea.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度