Have Redis setup with ruby on ubuntu server, but can't figure out how to access its log file. Tutorial says it should be here:
/var/log/redis_6379.log
But can't even find the /var/ folder
The log file will be where the configuration file (usually /etc/redis/redis.conf) says it is :) By default, logfile stdout which probably isn't what you are looking for. If redis is running daemonized, then that log configuration means logs will be sent to /dev/null, i.e. discarded.
Also the empty string can be used to force # Redis to log on the standard output. Note that if you use standard # output for logging but daemonize, logs will be sent to /dev/null logfile "redis_log" So the log file is created at /usr/local/var/db/redis/redis_log with the name redis_log
Using cat to read a log file can be a very bad if it is too long (which happens a lot in log files). Using less or tail will be safer This is a known, but someone may find it useful: When looking for signs of crash/issues, Redis log may not help much...it may just show normal op then service online messages.
Redis is a NoSQL database and is based on key-value storing. If you administrate applications and services, you typically want to discover information about the system service status. The logging of the application is the primary source of this information. Redis offers built-in support for logging with Syslog.
Found it with:
sudo tail /var/log/redis/redis-server.log -n 100
So if the setup was more standard that should be:
sudo tail /var/log/redis_6379.log -n 100
This outputs the last 100 lines of the file.
Where your log file is located is in your configs that you can access with:
redis-cli CONFIG GET *
The log file may not always be shown using the above. In that case use
tail -f `less /etc/redis/redis.conf | grep logfile|cut -d\ -f2`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With