Skip to content

Commit 6344bb8

Browse files
authored
Removed unwanted logs even if NginxModuleTraceAsError is set as false (#246)
1 parent 5c0cc9c commit 6344bb8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

instrumentation/otel-webserver-module/src/nginx/ngx_http_opentelemetry_module.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ static void stopMonitoringRequest(ngx_http_request_t* r,
11181118

11191119
if (OTEL_ISSUCCESS(res))
11201120
{
1121-
ngx_writeError(r->connection->log, __func__, "Request Ends with result code: %d", res);
1121+
ngx_writeTrace(r->connection->log, __func__, "Request Ends with result code: %d", res);
11221122
}
11231123
else
11241124
{
@@ -1150,7 +1150,7 @@ static void startMonitoringRequest(ngx_http_request_t* r){
11501150
return;
11511151
}
11521152

1153-
ngx_writeError(r->connection->log, __func__, "Starting Request Monitoring for: %s", r->uri.data);
1153+
ngx_writeTrace(r->connection->log, __func__, "Starting Request Monitoring for: %s", r->uri.data);
11541154

11551155
// Handle request for static contents (Nginx is used for habdling static contents)
11561156

@@ -1193,7 +1193,6 @@ static void startMonitoringRequest(ngx_http_request_t* r){
11931193
if (ctx == NULL)
11941194
{
11951195
ngx_writeError(r->connection->log, __func__, "Cannot allocate memory for handles");
1196-
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "Cannot allocate memory for handles");
11971196
return;
11981197
}
11991198
// Store the Request Handle on the request object

0 commit comments

Comments
 (0)