Logging

Your application code should be configured for writing logs to /webroot/logs

Because each deployment/release creates a new directory, your log files should be located outside of the application deployment directory. Logging to a directory outside of your deployment tree is the recommended way to peristent log files across deployments on Amezmo.

Recall the deployment directory tree layout on Amezmo. By default, the directory /webroot/logs is created for you when you launch an instance. We recommend using this directory for logging. After setting up your application log directory from code, you'll be able to see your logs from the Logs tab on Amezmo.

When you launch an instance, a default .env file is generated for you. The variable LOG_PATH is set to the the value /webroot/logs/laravel.log. You may use this variable to easily port your code to different environments.

Configuration for persistent logs

Laravel applications provide a logging configuration entry that you may change. The following configuration is recommended. Laravel provides a configuration path attribute that lets you specify the directory to which your logs files should be written to. See below for the recommended directory to use on Amezmo.

This file is located at app/config/logging.php. The

<?php

return [

    'default' => 'stack',
    'channels' => [
        'daily' => [
            'driver' => 'daily',
            'permission' => 0664,
            'path' => env('LOG_PATH', '/webroot/logs/laravel.log'),
            'level' => 'debug',
            'days' => 14,
        ],
    ],

];

Resources

Need support?

We're always happy to help with either application or infrastructure questions Always feel free to reach out to us on Twitter, or contact support.

Subscribe