Entreprise Library Rolling flat file is not rolling

半腔热情 提交于 2019-12-05 09:18:20
Grigori Melnik

I managed to reproduce your example.

It appears that your problem is in the time-stamp pattern. You use colon (:) as a delimiter for minutes and seconds; when the timestamp gets concatenated to the file name, that name doesn't get accepted because the colon is a reserved character. You don't see the error, since your 'errors' special source is also configured to use the Rolling Flat File Trace Listener.

Replace colon with space, dash, underscore or any other character which is valid for a file name and everything will work. Also, consider configuring a separate listener for the error category.

Also, since you chose rollFileExistsBehavior="Increment" and not "Overwrite", it will add a .1 suffix to each file. The suffix will not increment, since you are going to get a new file every second. You may want to remove ss from the time pattern or change the rollFileExistsBehavior.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!