New to nxlog and have it deployed on several test systems.

I have multiple logs under C:\Program Files\nxlog\data called which combined are more than 27GB of data.

and so on...

Are these the logs that are generated by om_file module? How do I rotate these? I've read the documentation, but am a little confused. I've outlined the criteria that I'm wanting to implement for log retention - any help is much appreciated.

Desired Retention Criteria

  • Each log file is 100mb in size
  • No more than 5 log files
  • Anything beyond that is deleted
AskedSeptember 8, 2020 - 4:31pm

Answer (1)


Usually there is internal NXLog logs are placed in this file. But could I see your config to be sure?

Regarding logs rotation you could use code like this:

<Extension _fileop>
    Module xm_fileop

    # Check the log file size every hour and rotate if larger than 100 MB
    # Also no more than five previous files are stored simultaneously
        Every 1 hour
            if (file_exists('%LOGFILE%') and file_size('%LOGFILE%') >= 100M)
                file_cycle('%LOGFILE%', 5);

Regards, Arch