•  
      request #42586 Do not always log business errors in Artidoc
    Infos
    #42586
    Joris MASSON (jmasson)
    2025-04-03 11:46
    2025-04-02 18:02
    44262
    Details
    Do not always log business errors in Artidoc

    In Artidoc REST API, every possible business error is logged in the REST API syslog with error level. It means that whenever someone tries to get an artidoc they cannot see (for example), it will produce a 404 and also be logged in error with details about why (the permission was not allowed, for example).

    While having logs is usually better than having none, those cases are completely expected. Even if someone asks us "why can't I see my Artidoc in the REST API?", the answer is always going to be "check that it exists and check your user group permissions", and we don't need to search for that in logs (that are going to be kilometers long). It's also not an "error": enforcing permissions is the correct way to deal with this case, the application is in a completely expected state.

    Therefore, I propose to change this and log only unexpected states with an error level. This means all cases of "not found", no read permission, no write permission, incoherent request, etc. will just produce the appropriate HTTP code and will not be logged anymore.

    API
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Joris MASSON (jmasson)
    Closed
    2025-04-03
    Attachments
    Empty
    References

    Follow-ups