Log files not being created?

Hi,

With the current edition of Sage 10, I just noticed that PHP errors aren’t being written to log files in my local dev environment anymore.

In the previous “2021 edition” of Sage10, errors were written to:

/wp-content/themes/[sage]/storage/logs/application-YYYY-MM-DD.log.

Now with the current/stable edition of Sage10, the path seems to now be:

/wp-content/cache/acorn/logs

…but no .log files are being written there, e.g., when I trigger a php error/warning/notice on purpose. The folder just remains empty.

Am I missing something? (Yes, WP’s debug constants are still enabled; and both test sites are using Acorn 2.0.3)

The Symfony error screen is nice, but having log files is particularly valuable when php errors occur behind the scenes with in the block editor, for example.

Any help / insight is appreciated!

It looks like this commit may have been when the behavior changed: feat(zeroconfig): Add support for zero-config (#139) · roots/acorn@c2d8571 · GitHub You might be able to adjust the settings in the logging config and get the result you want, although it does seem odd that we’d make a decision that disables system logging by default. Maybe @QWp6t can weigh in, I confess I don’t understand exactly how the error logging is set up.

1 Like

Thanks @alwaysblank! The explanation helped me get logging to the filesystem working again.

Here’s what I did:

  1. copied the contents of that file to /themes/[sage]/config/logging.php (with the “new” Sage10, the config folder needed to be created).

  2. replaced the null value in line #20 to stack so the result is:
    'default' => env('LOG_CHANNEL', 'stack'),
    (or, use daily to get the date appended to the filename).

Perhaps there’s a cleaner way, but I’m satisfied to have the logs back again :slight_smile:

Appreciate the insight!

2 Likes