I want to build a log file in memory using a StringBuilder
, so I have a
private StringBuilder logFile = new StringBuilder();
in my controller class. Later than I append log lines to that object.
But after each request it is cleared. How do I keep the contents during multiple requests/views? What's the best approach?