I found an open issue on Github related to the problem I have
https://github.com/JuliaOpt/CPLEX.jl/issues/42I tried the first part of the suggestion (Joey's) before calling the solver
JuMP.build(m)
intm = internalmodel(m).inner
CPLEX.set_logfile(intm.env, "myoutput.txt")
but I get an error saying MethodError: no method matching unsafe_convert(::Type{Ptr}{Void}}, ::CPLEX,Env)