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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题