@@ -28,7 +28,7 @@ public AppealsController(
2828 [ ProducesResponseType ( StatusCodes . Status400BadRequest ) ]
2929 public async Task < ActionResult < Appeal > > SubmitAppeal ( [ FromBody ] Appeal appeal )
3030 {
31- _logger . LogInformation ( "Submitting appeal for claim {ClaimId}" , appeal . ClaimId ) ;
31+ _logger . LogInformation ( "Submitting appeal for claim {ClaimId}" , SanitizeForLog ( appeal . ClaimId ) ) ;
3232
3333 // Validation
3434 if ( string . IsNullOrEmpty ( appeal . ClaimId ) )
@@ -118,7 +118,7 @@ public async Task<ActionResult<IEnumerable<Appeal>>> SearchAppeals(
118118 [ FromQuery ] int pageSize = 50 )
119119 {
120120 _logger . LogInformation ( "Searching appeals: member {Member}, provider {Provider}, status {Status}" ,
121- memberId , providerNPI , status ) ;
121+ SanitizeForLog ( memberId ) , SanitizeForLog ( providerNPI ) , status ) ;
122122
123123 var appeals = await _appealRepository . SearchAsync (
124124 memberId , providerNPI , submittedFrom , submittedTo , status , lineOfBusiness , page , pageSize ) ;
@@ -153,7 +153,7 @@ public async Task<ActionResult<Appeal>> AddAttachment(string id, [FromBody] Appe
153153 var updated = await _appealRepository . UpdateAsync ( appeal ) ;
154154
155155 _logger . LogInformation ( "Added attachment {AttachmentId} to appeal {AppealId}" ,
156- attachment . AttachmentId , id ) ;
156+ SanitizeForLog ( attachment . AttachmentId ) , SanitizeForLog ( id ) ) ;
157157
158158 return Ok ( updated ) ;
159159 }
@@ -248,7 +248,7 @@ public async Task<ActionResult<Appeal>> SubmitDecision(string id, [FromBody] App
248248
249249 var updated = await _appealRepository . UpdateAsync ( appeal ) ;
250250
251- _logger . LogInformation ( "Appeal {AppealId} decision: {Decision}" , id , decision . DecisionType ) ;
251+ _logger . LogInformation ( "Appeal {AppealId} decision: {Decision}" , SanitizeForLog ( id ) , decision . DecisionType ) ;
252252
253253 return Ok ( updated ) ;
254254 }
@@ -291,6 +291,13 @@ public async Task<ActionResult<AppealsSummary>> GetAppealsSummary(
291291
292292 return Ok ( summary ) ;
293293 }
294+
295+ private static string SanitizeForLog ( string ? value )
296+ {
297+ if ( string . IsNullOrEmpty ( value ) )
298+ return string . Empty ;
299+ return value . Replace ( "\r " , string . Empty ) . Replace ( "\n " , string . Empty ) ;
300+ }
294301}
295302
296303public class UpdateAttachmentStatusRequest
@@ -309,3 +316,4 @@ public class UpdateStatusRequest
309316{
310317 public AppealStatus Status { get ; set ; }
311318}
319+
0 commit comments