我在Redis配置文件中添加了以下路径:
/c/ProgramData/chocolatey/lib/redis-64/redis.windows.conf
# Specify the server verbosity level.
# This can be one of:
# debug (a lot of information, useful for development/testing)
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
loglevel notice
# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output.
logfile "~\AppData\Local\Temp\redis_mailserver.log"
但是,当服务器尝试启动时,它将引发此错误:
redis-server start "~\AppData\Local\redis\mailscript_redis.conf"
Could not open logfile ~\appdata\local\temp\redis_mailserver.log: The system cannot find the path specified.
验证位置是否存在:
MINGW64 ~/AppData/Local/redis
$ ls -alh ~/AppData/Local/ | grep Temp | sed -e 's/${USERNAME}/username/g'
drwxr-xr-x 1 username 197609 0 Aug 7 22:23 SquirrelTemp/
drwxr-xr-x 1 username 197609 0 Aug 10 10:24 Temp/
lrwxrwxrwx 1 username 197609 56 Nov 4 2018 Temporary Internet Files -> /c/Users/username/AppData/Local/Microsoft/Windows/INetCache/
我希望能够为该脚本的用户临时文件使用标准的常规位置,因为日志可能会很大,而且我真的不能期望用户每隔几周就清理一次,所以我不知道该怎么办我应该解决这个问题。
我还尝试了以下日志设置:
# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output.
logfile "~/AppData/Local/Temp/redis_mailserver.log"
完全限定的路径(用户名已更改):
# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output.
logfile "/c/Users/username/AppData/Local/Temp/redis_mailserver.log"
不引用字符串:
# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output.
logfile /c/Users/username/AppData/Local/Temp/redis_mailserver.log
所有结果相同。