duanrang3357 2014-02-27 16:51 采纳率: 0%
浏览 953
已采纳

Laravel没有创建日志文件。

I'm learning Laravel 4.0 to develop a webserver.
I'm using a LAMP stack (Apache 2, php 5.5).
I can't find the log file where Log::error() calls writes to.
As far as I know it's supposed to be to app/storage/logs/log-cli-.txt but there are no files there.

Here is the code:

app/commands/MsgCommand.php
public function fire(){
   Log::error('messages - log');
}

It's called from artisan:

app/start/artisan.php
Artisan::add(new MsgCommand());

Am I looking in the right place?
How can I check that this is indeed the right folder (i.e. where is it configured)? To check for faulty installation or setup.

Thanks to marcanuy, I am now sure it is writing to app/storage/logs.
Also I found out it writes fine if I call the command through artisan. Running on apache 2 nothing happens though. I'm starting to think I set up the command wrong.

  • 写回答

2条回答 默认 最新

  • dongshi1102 2014-03-18 12:54
    关注

    The problem was permissions.
    User permissions for the www-var user in the ../app/storage
    And MySQL settings: Creating a user corresponding to what is set in the app/config/database.php

    'mysql' => array(
                'driver'    => 'mysql',
                'host'      => 'your host',
                'database'  => 'your db',
                'username'  => 'your user',
                'password'  => 'your pass',
               ),
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败