core icon indicating copy to clipboard operation
core copied to clipboard

[Logging] : Log less page details when making an unauthorized GraphQL request for a working page (edit mode)

Open valentinogiardino opened this issue 1 year ago • 1 comments

Parent Issue

No response

Problem Statement

We are logging too much information about a page when making a GraphQL request for a working page (edit mode) without authentication. image

Steps to Reproduce

  • Make a GraphQL request for a working page (edit mode) without authentication. For example:
query {
  page(url: "/index", pageMode: "WORKING") {
    title
  }
}
  • Inspect the logs

Acceptance Criteria

  • [ ] The log should show less information about the page

dotCMS Version

Tested on trunk_52d3299

Proposed Objective

Code Maintenance

Proposed Priority

Priority 4 - Trivial

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

Slack conversation: https://dotcms.slack.com/archives/CQNF9PCFQ/p1723654751826279

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

valentinogiardino avatar Aug 20 '24 00:08 valentinogiardino

We still needing some work here:

  • Basically now we are not returning extra information about the piece of content, but now we are returning two errors in the log that is duplicating the failure, and at the end we are printing a WARN with the graphQL schema that we can exclude from the log. LOG: https://gist.github.com/bryanboza/9ae75b31303fbe5d6055ae23a544eba9

We can remove one of those exceptions and also we need to remove the WARN.

bryanboza avatar Aug 27 '24 21:08 bryanboza

@bryanboza we will remove the duplicate.

The warning is logged by a third-party library. Therefore, that logging level can be defined in the log4j configuration.

nollymar avatar Sep 19 '24 20:09 nollymar

Internal QA: Passed.

As we can see in the following image, the error message is now showing the minimal information required to report the error.

Request: Image

Log trace: Image

It was tested using the docker image dotcms/dotcms:trunk_042b378

dcolina avatar Sep 24 '24 16:09 dcolina

Fixed, tested on trunk // Docker // FF

bryanboza avatar Sep 25 '24 19:09 bryanboza