ParseError is not being logged

Created on 28 July 2022, over 2 years ago
Updated 26 July 2024, 5 months ago

Problem/Motivation

When causing a ParseError for example by typing some invalid syntax in web/core/modules/field/src/Entity/FieldConfig.php (something like

protected $deleted = FALSE;76868

the error

ParseError: syntax error, unexpected integer "76868"

is not being written into the file log even though it *is* written into the normal db log. Even after calling the cron, it's not being written into the file log.

Steps to reproduce

see above

I suspect the logger doesn't catch that? Or is it because it's not an exception but an Error?

Thanks in advance

Bye Defcon0

πŸ› Bug report
Status

Closed: works as designed

Version

2.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine mr_fenix

    Hello,

    dblog and filelog modules work a bit differently. dblog simply writes errors to a database, but filelog not only logs errors to a file, it also formats them using token module's functionality. This means that all modules providing tokens for this module must do it absolutely without errors.

    In your case, you changed not just any file, but a Drupal core file, which is necessary for the entities to function. As a result, this https://git.drupalcode.org/project/filelog/-/blame/2.0.x/filelog.tokens....
    causes an issue described here.
    When incorrect syntax is used outside the core, there is no behavior like this.

    Since it is assumed that core files will never have the parse issue specified here, I'm not sure if this can be interpreted as an bug and if it makes sense to change it.

    If you frequently encounter parsing issues within the core, a workaround could be using the [user:uid] token instead [log:user] inside format string.

    If someone believe it is issue please change status.

  • Status changed to Closed: works as designed 5 months ago
Production build 0.71.5 2024