Skip to content
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

SeasLog::setDatetimeFormat()不起作用 #140

Closed
ms100 opened this issue Aug 8, 2017 · 2 comments
Closed

SeasLog::setDatetimeFormat()不起作用 #140

ms100 opened this issue Aug 8, 2017 · 2 comments

Comments

@ms100
Copy link

ms100 commented Aug 8, 2017

SeasLog::setDatetimeFormat('m-d H:i:s');
ini_set('seaslog.default_datetime_format','Y-m-d H:i:s');
都显示成功设置,但是不起作用

@Neeke
Copy link
Member

Neeke commented Aug 10, 2017

请注明,什么版本,什么环境,谢谢

@Neeke
Copy link
Member

Neeke commented Aug 15, 2017

不要使用 SeasLog::setDatetimeFormat('m-d H:i:s'); 将不生效,因为在请求开始时,default_datetime_format已经被赋值给current_datetime_format,最终使用的是 current_datetime_format

使用SeasLog::setDatetimeFormat('m-d H:i:s');是正确的。
这将改变current_datetime_format的值。
出于性能考虑,时间格式的改变将被缓存一秒钟,也就是一秒钟后将生效,在调用setDatetimeFormat时应该立刻改变这一秒钟的缓存,这是一个Bug,目前已修复。

@Neeke Neeke closed this as completed in a3c9b5f Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants