我在 Windows Server 2012 R2 上使用 nxlog-ce。
nxlog 正在输出两个 txt 文件。
我想每小时轮换这两个文件。我希望活动日志保持相同的名称,logfileA.txt logfileB.txt 和要创建的新旋转文件 logfileA.txt.2 logfileB.txt.2
我只希望每个日志 logfileA.txt 和 logfileA.txt.2 有两个文件,但从不希望 logfileA.txt.3
这是我当前 nxlog.config 中的重要部分
define LOGFILE_Atxt C:\test\logfileA.txt
define LOGFILE_Btxt C:\test\logfileB.txt
<Extension fileop>
Module xm_fileop
<Schedule>
Every 1 hour
Exec file_cycle('%LOGFILE_Atxt%', 2);
Exec file_cycle('%LOGFILE_Btxt%', 2);
</Schedule>
</Extension>
<Output loga_out>
Module om_file
file 'c:\test\logfileA.txt'
CreateDir TRUE
</Output>
<Output logb_out>
Module om_file
file 'c:\test\logfileB.txt'
CreateDir TRUE
</Output>
<Route loga_route>
Path loga_input => loga_out
</Route>
<Route logb_route>
Path logb_input => logb_out
</Route>
在此配置中,当 nxlog 服务启动时,它会立即创建 logfileA.txt.1 和 logfileB.txt.1 但是,系统从不轮换日志。永远不会创建 logfileA.txt.2 和 logfileB.txt.2。
我无法找到有关如何使用 nxlog 设置日志轮换的资源。
任何帮助是极大的赞赏。谢谢!