问题 Is there any option/configuration in NLog to set the max log file size (for example 5MB)? What I need is, that when the log file exceeds the max size (which I define), It will backup the old one (with a time stamp as file name), and start writing to a new one. How can this be done? I would prefer some kind of build-in configuration, but if there is none can this be done safely manually without corrupting the log file? 回答1: You can set archiveNumbering="DateAndSequence" and archiveAboveSize=