Available values: PRETTY_PRINT_WITH_NULLS, PRETTY_PRINT_NO_NULLS, COMPACT_WITH_NULLS, MINIMAL, AS_IS.
By default it’s PRETTY_PRINT_WITH_NULLS
Here PRETTY_PRINT means “pretty printed JSON”.
COMPACT_WITH_NULLS and MINIMAL also mean JSON but not “pretty printed”
See the difference
COMPACT_WITH_NULLS and MINIMAL
{"user":{"firstName":"John","lastName":"Smith","password":"passasdfasdf","email":"XXXMASKEDXXX"}}
PRETTY_PRINT_WITH_NULLS and PRETTY_PRINT_NO_NULLS
{
"user":{
"firstName":"John",
"lastName":"Smith",
"password":"passasdfasdf",
"email":"XXXMASKEDXXX"
}
}
Use PRETTY_PRINT_WITH_NULLS and COMPACT_WITH_NULLS if you want to log (serialize nulls)
Use PRETTY_PRINT_NO_NULLS and MINIMAL if you want to exclude nulls from logging.
AS_IS is used if you want to serialize the parameters and returned result with the toString method. In this case maskFields will be ignored