2

Is there any way that Hibernate exception message could be controlled so that it doesn't include the placeholder data for the failed query. e.g. for a failed insert query (lets say constraint violation), hibernate logs the exception with the input data. For privacy purpose, this needs to be removed from the logs.

Obaid Maroof
  • 1,523
  • 2
  • 19
  • 40

1 Answers1

1

I am not aware of any Hibernate configuration for this, but I would say that this is more suitable for logging configuration anyway.

For example, in log4j you could write custom appender/layout to intercept and replace the messages with the desired content.

Community
  • 1
  • 1
Dragan Bozanovic
  • 23,102
  • 5
  • 43
  • 110