Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kdivanov committed Mar 11, 2024
1 parent 5db78b2 commit 95fdd12
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions service/component/request_logger/db_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ func (g *DBLogger) LogRequest(ormService *beeorm.Engine, appName, url string, re
func (g *DBLogger) LogResponse(ormService *beeorm.Engine, requestLoggerEntity *entity.RequestLoggerEntity, responseBody []byte, status int) {
requestLoggerEntity.Status = status

if len(responseBody) > 0 && len(string(responseBody))*4 <= 64000 {
requestLoggerEntity.Response = responseBody
} else {
requestLoggerEntity.Response = []byte("Partial BODY \n\n")
requestLoggerEntity.Response = append(requestLoggerEntity.Response, responseBody[0:16000]...)
if len(responseBody) > 0 {
if len(string(responseBody))*4 <= 64000 {
requestLoggerEntity.Response = responseBody
} else {
requestLoggerEntity.Response = []byte("Partial BODY \n\n")
requestLoggerEntity.Response = append(requestLoggerEntity.Response, responseBody[0:16000]...)
}
}

if len(string(requestLoggerEntity.Log))*4 > 64000 {
Expand Down

0 comments on commit 95fdd12

Please sign in to comment.