D
Dave Saville
I am writing a script that takes a named pipe as input, does a little
massaging of the text and then writes it to syslog. The data could
come infrequently or in bursts depending on the output of the daemon
whose pipe I am reading.
The question is, which is best practice?
1) Inside the read pipe loop - openlog, write, close log for every
line.
2) Openlog outside the pipe read loop and write each line as it comes?
ie keep the file open.
Google does not suggest an answer. I tend to 1) but it is a heck of an
overhead if a few thousand lines hits the fan.
TIA
massaging of the text and then writes it to syslog. The data could
come infrequently or in bursts depending on the output of the daemon
whose pipe I am reading.
The question is, which is best practice?
1) Inside the read pipe loop - openlog, write, close log for every
line.
2) Openlog outside the pipe read loop and write each line as it comes?
ie keep the file open.
Google does not suggest an answer. I tend to 1) but it is a heck of an
overhead if a few thousand lines hits the fan.
TIA