laravel日志写入方法之一: Log::info('Showing user profile for user: 147258369');把日志写入到某个方法中之后,执行方法之后,日志存储起来. 日志查看在:storage/logs中查看 八种日志级别: Log::emergency($message); Log::alert($message); Log::critical($message); Log::error($message); Log::warning($message); L
如果任由访问日志写下去,日志文件会变得越来越大,甚至是写满磁盘. 所以,我们需要想办法把日志做切割,比如每天生成一个新的日志,旧的日志按规定时间删除即可. 实现日志切割可以通过写shell脚本或者系统的日志切割机制实现. shell脚本切割Nginx日志 切割脚本内容: #!/bin/bash logdir=/var/log/nginx #定义日志路径 prefix=`date -d "-1 day" +%y%m%d` #定义切割后的日志前缀 cd $logdir for f in `
Apache日志默认情况下是一周切割一次,由于访问量大的时候日志的文件还是比较大的,同时也不利于管理员对日志的分析处理.于是尝试对Apache日志设置按天分割,并通过计划任务执行删除几天的日志. 配置文件修改: # # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See <