If I use <write> to write log lines to an output file, is there any buffering of the output before it writes to file? If so, can the size of the buffer be controlled? Would flush be used if there is data in the buffer?
<write> does buffer, and the buffer size can't be controlled. You could use either <flush> or </write> to flush the data. For log files it's generally best to generate the log line and then write it out as a single item, e.g.
Is there a particular concern? In general the most predictable method would be to generate the logline, e.g. with <capture>, including the newline, and output to the log in a single <write>...</write> using either $-logline or <fmt "%s" $logline> if an older texis. That will attempt to write the entire line in one shot. Generally each Vortex statement inside the <write> will be written individually. If the logline is longer than the OS can handle it might be split into multiple writes, but that's beyond our control.
<write> uses a dynamically-sized buffer. It buffers the entire contents of a single print-to-output Vortex statement, then writes that output in a single write() system call to the <write> file. Literal Vortex text is buffered, up to a line I think. There may be exceptions to these rules but I can't find any offhand.