mam taka fukcnje :
public static String showClassError() throws IOException {
Iterator<String> iterator = errorCount.keySet().iterator();
String response = "";
while(iterator.hasNext()) {
String key = iterator.next().toString();
Integer value = errorCount.get(key);
System.out.println(key + " : " + value);
System.getProperty("line.separator");
response+=key + " : " + value + "\n";
System.lineSeparator();
}
return response;
}
ona przechodzi po mapie i daje mi zliczone logi , wynik :
[com.sbbetting.applications.betting.api.text.Texts : 1346
[com.sbbetting.odds.common.transactions.TransactionsController : 1
[com.sbbetting.applications.betting.api.rest.request.CashOutRequest : 636
[org.jboss.as.ejb3.invocation : 189
[com.sbbetting.applications.betting.api.navigation.Event : 102
[com.sbbetting.applications.betting.api.customer.Registration : 35
[com.sbbetting.applications.betting.api.rest.request.CommonRequest : 19
zapisuje to do pliku txt ale niestety nie moge zrobic zeby zapisalo mi wszystko w nowej linii ;/ pomocy
robie to tak :
bw.write(showClassError());
bw.newLine();