log4php - 在 log4php.properties 中动态更改日志文件名称
您好,如何动态更改 log4php.properties 中的日志文件名和路径
log4php.appender.A8.File=../logs/logs.log
谢谢
hi how can i change the log file name and path in log4php.properties dynamically
log4php.appender.A8.File=../logs/logs.log
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
2 条有用的信息:
(1)user367134 之前的回答很有帮助,但它有一个错误:设置级别时,不应将其设置为
LoggerLevel::DEBUG
表示的常量整数值。您应该使用 LoggerLevel::toLevel() 函数来获取 LoggerLevel 对象。即,
应该是:
(2) 这是与上面的示例类似的示例,但有一些差异:
代码:
2 useful pieces of information:
(1) The previous answer by user367134 is helpful, however it has a bug: when setting the level you should not set it to the constant integer value denoted by
LoggerLevel::DEBUG
. You should instead make use of theLoggerLevel::toLevel()
function to obtain a LoggerLevel object.i.e.,
Should instead be:
(2) Here is a similar example to the one above, with a few differences:
The code:
好吧,这不是我的代码,但这里是示例代码和网站链接
实际网站链接
归功于“AKJOL”
Well its not my code, But here is the sample code and link to the site
Actual Site Link
Credit goes to "AKJOL"