redis view log
Redis does not generate log files by default, so you need to configure it
Configuration method
1. First find the redis configuration file
2. Open the configuration file and find the logfile (there may be multiple logfiles, make sure there is loglevel), or directly search for logfile ""
3. Fill in the path in the quotation marks after logfile, for example: logfile "d:/redislog/redis.log" (pay attention to the direction of the inclined bar, this The direction of the slope bar in windows cmd is opposite)
4. Manually create the log folder according to the path you wrote. There is no need to create the log file, just create it in the folder. For example, I will do it manually. Created the d:\redislog folder
5. Save the configuration file and start redis with this configuration file. Then the redis startup box will turn into a black box and there will be no output. That’s right. (Because all the input is written to the log file)
Then you can go to the d:\redislog\redis.log folder to view the log (redis tutorial)
Notes
1. Redis must be started with a configuration file. If it is started directly, it will use the default configuration (and this default configuration file does not exist, so don’t think change it).
2. If a prompt appears, it means that the configuration file is not specified or the configuration file cannot be read (path error)
3. Loglevel is used to set the log level. You can see the configuration file for details. Comments
aboveThe above is the detailed content of How to view redis logs. For more information, please follow other related articles on the PHP Chinese website!