Null bytes in a file created by 2> rotated with logrotate?

Solution 1:

You need to redirect stderr using 2>> (append). This is an issue with files opened without the O_APPEND flag and logrotate's copytruncate.