How do I get the output messages from ogr2ogr, when I call it from another windows application?
I have tried with standard "ogr2ogr.exe>log.txt", but it keeps writing to the console.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityHow do I get the output messages from ogr2ogr, when I call it from another windows application?
I have tried with standard "ogr2ogr.exe>log.txt", but it keeps writing to the console.
There are two output streams for a console. 1 is the standard output and 2 is the error output stream. When you do my.exe > myfile.txt
it send the standard output (1) to the file, and keeps the error in the console. You could want to send the errors to a different file, or to the standard output. To do this, you would indicate to send the errors (2) to the standard output stream (1) my.exe > myfile.txt 2>&1
This old but accurate doc gives further details.
For the case you reported, the command would be ogr2ogr.exe>log.txt 2>&1
ogr2ogr.exe>log.txt 2>&1
– JGH Jan 31 '18 at 13:02