简体   繁体   中英

Laravel 5.7 log error after deploying to Heroku

I am having some issues after deploying a Laravel app to Heroku. Locally it works fine, nevertheless the problem arises after deployment.

I am receiving this error at every attempt to connect to the production app.

at StreamHandler->write(array('message' => 'There is no existing directory at "/home/vagrant/Webs/eco/storage/logs" and its not buildable: Read-only file system', 'context' => array('exception' => object(UnexpectedValueException)), 'level' => 400, 'level_name' => 'ERROR', 'channel' => 'local', 'datetime' => object(DateTime), 'extra' => array(), 'formatted' => '[2019-03-11 03:12:36] local.ERROR: There is no existing directory at "/home/vagrant/Webs/eco/storage/logs" and its not buildable: Read-only file system {"exception":"[object] (UnexpectedValueException(code: 0): There is no existing directory at \\"/home/vagrant/Webs/eco/storage/logs\\" and its not buildable: Read-only file system at /app/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:171)[stacktrace]
#0 /app/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(97): Monolog\\\\Handler\\\\StreamHandler->createDir()
#1 /app/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php(119): Monolog\\\\Handler\\\\StreamHandler->write(Array)

My composer.json file looks like this:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "dingo/api": "2.0.0-alpha2",
        "fideloper/proxy": "^4.0",
        "fzaninotto/faker": "^1.8",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "league/flysystem-aws-s3-v3": "^1.0",
        "maatwebsite/excel": "^3.1",
        "tymon/jwt-auth": "1.0.0-rc.3",
        "zizaco/entrust": "dev-master"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

What is odd to me is the fact that Laravel is looking for the local log file in the production environment.

Any help is appreciated. Thanks.

您是否对配置文件config/cache.php进行了任何更改

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM