Skip to content

Integrate Automatic CURL Generation with Logging Frameworks #62

@mozhganEtaati

Description

@mozhganEtaati

Currently, HttpClientToCurlGenerator allows generating CURL commands manually from HttpClient requests.

In many production scenarios, developers want to log HTTP requests automatically for debugging, monitoring, or auditing. Integrating CURL generation directly with popular logging frameworks would save time, reduce errors, and improve developer experience.

Proposed Feature

Send the generated CURL to the logging framework of your choice (.NET Logging, Serilog, NLog,...).
Provide flexible configuration options, such as:

  • Which log level to use (Debug, Info, etc.)
HttpClient client = new HttpClient();
client.EnableCurlLogging(logger, httpRequestMessageInstance, config => {
     config.NeedAddDefaultHeaders = true;
     config.LogLevel = LogLevel.Debug;
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions