[英]It is possible to make the Code Igniter write into one file?
It is possible to make the Code Igniter write into one file ? 是否可以使Code Igniter写入一个文件? Instead of many files:
代替许多文件:
admn@comp:~$ ll application/logs/
total 22916
drwxr-xr-x 2 admn www-data 4096 Feb 12 23:43 ./
drwxr-xr-x 15 admn www-data 4096 Feb 12 23:43 ../
-rwxr-xr-x 1 admn www-data 114 Feb 12 23:43 index.html*
-rwxr-xr-x 1 admn www-data 123984 Feb 12 23:43 log-2013-11-26.php*
-rwxr-xr-x 1 admn www-data 18051 Feb 12 23:43 log-2013-11-27.php*
-rwxr-xr-x 1 admn www-data 79681 Feb 12 23:43 log-2013-11-28.php*
-rwxr-xr-x 1 admn www-data 629424 Feb 12 23:43 log-2013-12-01.php*
-rwxr-xr-x 1 admn www-data 201280 Feb 12 23:43 log-2013-12-03.php*
-rwxr-xr-x 1 admn www-data 133149 Feb 12 23:43 log-2013-12-07.php*
This should for using logrotate in debian/ubuntu for rotate application log. 这应该用于在debian / ubuntu中使用logrotate来旋转应用程序日志。 Thank you!
谢谢!
create your own MY_Log class, ie application/libraries/MY_Log.php 创建自己的MY_Log类,即application / libraries / MY_Log.php
you can then extend the log class and write your own custom function: 然后,您可以扩展日志类并编写自己的自定义函数:
class MY_Log extends CI_Log {
public function writeMyLog($entry)
{
// do whatever you want
}
}
then use your own function to write instead of the built in codeigniter one. 然后使用您自己的函数而不是内置的代码点火器来编写。
or you can overwrite the write_log function which is CI's default method, by defining your own method in this class. 或者,您可以通过在此类中定义自己的方法来覆盖CI的默认方法write_log函数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.