如何指定日期间隔?
我想使用 RollingMode.Date 按日期记录。但默认间隔为一分钟。我查看了源代码,发现该类已保护枚举 RollPoint
/// <summary>
/// The code assumes that the following 'time' constants are in a increasing sequence.
/// </summary>
/// <remarks>
/// <para>
/// The code assumes that the following 'time' constants are in a increasing sequence.
/// </para>
/// </remarks>
protected enum RollPoint
{
InvalidRollPoint = -1,
TopOfMinute,
TopOfHour,
HalfDay,
TopOfDay,
TopOfWeek,
TopOfMonth
}
如何将 RollPoint 指定为 RollingFileAppender 对象?
谢谢!
I want to use RollingMode.Date to log by date. But default interval is one minute. I looked into source and saw, that class has protected enum RollPoint
/// <summary>
/// The code assumes that the following 'time' constants are in a increasing sequence.
/// </summary>
/// <remarks>
/// <para>
/// The code assumes that the following 'time' constants are in a increasing sequence.
/// </para>
/// </remarks>
protected enum RollPoint
{
InvalidRollPoint = -1,
TopOfMinute,
TopOfHour,
HalfDay,
TopOfDay,
TopOfWeek,
TopOfMonth
}
How to specify RollPoint to RollingFileAppender object?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用日志配置的
datePattern
属性。它缩小范围以添加
到您的附加程序配置。更多信息请参见此处。
You can use
datePattern
property of log configuration.It narrows down to adding
to your appender configuration. More information here.