I\'m working into a method trying to change the default rest-assured log (which goes to the console) to a file using log4j.
It\'s a JUnit project which methods final
PrintStream fileOutPutStream = new PrintStream(new File("somefile.txt"));
RestAssured.config = config().logConfig(new LogConfig().defaultStream(fileOutPutStream));
Use a printStream to point to a file & give a filename you want to print the log. Put the above code in your setup method for the tests & then just call log on your RequestSpecification instance as below
requestSpecification.log().all();