rest-assured/src/main/java/io/restassured/builder/RequestSpecBuilder.java
public RequestSpecBuilder log(LogDetail logDetail) {
        notNull(logDetail, LogDetail.class);
        RestAssuredConfig restAssuredConfig = spec.getConfig();
        LogConfig logConfig;
        if (restAssuredConfig == null) {
            logConfig = new RestAssuredConfig().getLogConfig();
        } else {
            logConfig = restAssuredConfig.getLogConfig();
        }
        PrintStream printStream = logConfig.defaultStream();
        boolean prettyPrintingEnabled = logConfig.isPrettyPrintingEnabled();
        boolean shouldUrlEncodeRequestUri = logConfig.shouldUrlEncodeRequestUri();
        spec.filter(new RequestLoggingFilter(logDetail, prettyPrintingEnabled, printStream, shouldUrlEncodeRequestUri));
        return this;
    }
public RequestSpecBuilder log(LogDetail logDetail) {
        notNull(logDetail, LogDetail.class);
        RestAssuredConfig restAssuredConfig = spec.getConfig();
        LogConfig logConfig;
        if (restAssuredConfig == null) {
            logConfig = new RestAssuredConfig().getLogConfig();
        } else {
            logConfig = restAssuredConfig.getLogConfig();
        }
        PrintStream printStream = logConfig.defaultStream();
        boolean prettyPrintingEnabled = logConfig.isPrettyPrintingEnabled();
        boolean shouldUrlEncodeRequestUri = logConfig.shouldUrlEncodeRequestUri();
        spec.filter(new RequestLoggingFilter(logDetail, prettyPrintingEnabled, printStream, shouldUrlEncodeRequestUri));
        return this;
    }
public RequestSpecBuilder log ( LogDetail logDetail ) { notNull ( logDetail , LogDetail . class ) ; RestAssuredConfig restAssuredConfig = spec . getConfig ( ) ; LogConfig logConfig ; if ( restAssuredConfig == null ) { logConfig = new RestAssuredConfig ( ) . getLogConfig ( ) ; } else { logConfig = restAssuredConfig . getLogConfig ( ) ; } PrintStream printStream = logConfig . defaultStream ( ) ; boolean prettyPrintingEnabled = logConfig . isPrettyPrintingEnabled ( ) ; boolean shouldUrlEncodeRequestUri = logConfig . shouldUrlEncodeRequestUri ( ) ; spec . filter ( new RequestLoggingFilter ( logDetail , prettyPrintingEnabled , printStream , shouldUrlEncodeRequestUri ) ) ; return this ; }
Enabled logging with the specified log detail. Set a {@link LogConfig} to configure the print stream and pretty printing options.

@param logDetail The log detail.
@return RequestSpecBuilder
Enabled logging with the specified log detail . Set a { @link LogConfig } to configure the print stream and pretty printing options .