George
01/26/2023, 3:10 PMdata class UpdateCarrierServerFailure(
val status: HttpStatus = HttpStatus.NOT_FOUND,
val message: String
) : UpdateCarrierServerResult() {
init {
logger().error(this.message)
}
}
Im trying to explain to the author why it is bad to log like that. Any ideas or any other pov is welcomed !George
01/26/2023, 3:10 PMWhy it is bad: We should log based on events rather on data. If there is a case where we need to associate a logger with data construction we can always log it on service layer.
Joffrey
01/26/2023, 3:13 PM