Printing progress and updates messages SDE problem

I’m solving a system of stochastic differential equations:

#define drift fuction
#define noise function 

#constructing and solving the problem

u_0=zeros(100,100)#initial condition

solution=solve(problem,SOSRA(),reltol=1e-3,abstol=1e-3,save_everystep = false) 

Now, I read here that you can use the keyword argument “progress” to get updates on the remaining number of seconds to complete the run, and you can get this information with a frequency set by the argument “progress_steps”:

solution=solve(problem,SOSRA(),reltol=1e-3,abstol=1e-3,save_everystep = false,progress_true,progress_steps=1000) 

However, I would be interested in getting more detailed updates from the solver, like current chosen dt (for adaptive algorithm), current time t, and current maximum value of the solution u_{max}. I read here that this should be possible with “progress message” at least for ODE’s. However I don’t know the precise syntax to make it work.
Also, I would like to possibly print these updates into a .txt file rather than having them in the terminal. Is there a way to do that?

function prog_message(dt, u, p, t)
    "Print a message here for the progress bar"
solution=solve(problem,SOSRA(),reltol=1e-3,abstol=1e-3,save_everystep = false,progress_true,progress_steps=1000, progress_message = prog_message) 

You can use a DiscreteCallback with condition=true so it launches after each step and just write any function into the affect! to perform the logging. See: