Rotate as soon as exactly one line is written
Hey guys,
first of all, thanks for this very nice tool! It's been a great help.
Now, to my issue. I start x services, and I would like to see and process each their stdout / stderr line in another process as soon as it happens. This is the setup I tried with nssm:
AppStdout = `${this.consolePath}/stdout.log`
AppStderr = `${this.consolePath}/stderr.log`
AppRotateFiles = "1"
AppRotateOnline = "1"
AppRotateBytes = "1"
I don't want to have another process wrapping the service as it is just an overkill, I want to watch for the files that are stdout-XXX.log and stderr-XXX.log, as I know those will not change.
So, the problems that happen with this approach:
- Readme states
On-demand rotations will happen after the next line of data is read, but that's not exactly true. I have files that are not lines, but have more than one line or split in the middle. For example:
stdout-20200324T110716.619.log:
VendorId : 4318
DeviceId : 6918
SubSysId
stdout-20200324T110716.620.log:
: 342890970
Revision : 161
DedicatedVideoMemory : 11667505152
DedicatedSystemMemory
-
In theory, I might have more than one line in stdout / stderr for a given millisecond, which makes rotate files naming bad.
-
Again, readme states
On-demand rotations will happen after the next line of data is read, which means that last line is held in original file (like stdout.log) until new line is written. This is dangerous for me to read, as the file can change etc, I should read it when it is instdout-xxx.logform. Is there a way to enable that rotation happens as soon as a line is written, not on the next line?
Thanks again for this great tool, really appriciate it! I'm aware I have very specific needs, but I guess behavior I need would be a great plus to the already great tool. Thanks!