catch sigpipe to avoid crashing. add size to logger