In your example, all the stacktrace lines were indented by a space. If that is true of your real log file, then to print all lines starting from the line number you specify (3 in your example) but stopping with the first non-indented line, try:
$ awk '{if (NR==3)f=1; else if (!/^ /)f=0} f{print}' trace.log
2016-10-07 15:49:07,537 ERROR Some exception
stacktrace line 1
stacktrace line 2
.
.
stacktrace line n
The above code works as follows:
if (NR==3)f=1On the line number you specify, set variable
fto one.else if (!/^ /)f=0On other lines, set
fto zero is the line is not indented.f{print}If
fis nonzero, print the line.