I have some code where most of the output is in @info statements using the Julia stdlib logger. I now have some big jobs which I want to run in the background and dump their logs somewhere. Normally I would do this with
julia bin.jl arg1 arg2 > outlog &
My problem is that when I do this the output from println and the like get properly redirected, but everything output by the logger still gets spit to stdout and, even worse, does not get spit to the log file.
I understand that it’s possible to use the logger to redirect to a log file as well, but the above procedure is super simple and works very nicely for 99% of use cases (were I only using println).
So, my question is, do I have no choice but to tell the logger to redirect it’s output? That would be a bit unfortunate as it would require me to have my program accept an additional command line argument rather than just having it use the existing functionality of bash.
That I do not know - all I know is that the logging interface is only semi-stable:
so this can (and probably will) change a little bit in the future. Your best bet right now is to either redirect it yourself if you want to redirect everything to one file, ore use either IOLogging or LoggingExtras. Both allow you to redirect each level separately.