-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
app一直打开 放置一宿 第二天手机开屏 直接打印日志 不会创建新一天的日志 会写入上一天的日志文件里 #69
Comments
会有这个问题,要做到准点切换文件代价比较大,而且就日志而言写到前一天影响也不会很大,基本上客户端日志 sdk 都有这个问题,你可以从应用层来解决哈 |
每次打印日志之前,我都把logutils的初始化配置在走一遍 也不会创建新一天的日志 为什么重启app 再走logutils的初始化配置之后 打印日志就可以创建新一天的日志呢, 因为我做的是商用设备 需要用到每一天的日志,有什么可以时间的方法吗? |
是因为Log2FileConfigImpl是单例模式吗 app重启后 才会重新创建嘛 |
没有时机去刷新文件哈,要固定到12点准时切换有点麻烦 |
只要在凌晨定时重新初始化一下,反射customFormatName参数为空就可以了
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
app一直打开 放置一宿 第二天手机开屏 直接打印日志 不会创建新一天的日志 会写入上一天的日志文件里
The text was updated successfully, but these errors were encountered: