ThinkPHP is a very popular PHP development framework. It provides very rich and practical functions, but it will inevitably generate some log files during use. These log files occupy a certain amount of disk space. If they are not cleaned up in time, they will Put a certain amount of pressure on the server. This article will introduce how to clear ThinkPHP logs.
1. Understanding ThinkPHP logs
In the process of using ThinkPHP, the following two types of logs will be generated:
1. System logs: stored in runtime# The
log folder under the ## directory includes request logs, exception logs, etc.
sql folder under the
runtime directory, recording detailed information about SQL execution.
log and
sql folders in the
runtime directory, and directly delete all the files in the folders.
config.php. Taking the log cleaning once a day as an example, we can add the following code in
config.php:
// 定时清理日志文件 'log' => [ // 日志记录方式,支持 file sae 'type' => 'file', // 日志保存目录 'path' => LOG_PATH, // 日志记录级别 'level' => [], // 日志清除时间,单位:天 'clear_time' => 1, ],The above code sets the log clearing time to 1 day, that is, the log is cleaned once a day. If you need to set other times, you only need to modify the value of
clear_time.
The above is the detailed content of How to clear thinkphp logs (two methods). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
