Skip to main content

Fault diagnosis and analysis

Error Logs

When mounting, you can specify the log save path with the --log=<log_path> parameter. When this parameter is not given, the log is written to the /var/log/juicefs.log file in plain text by default.

The log file is generated using glog library. There are 4 log levels. You can use the grep command to filter different levels of logs for performance analysis or troubleshooting:

$ cat /var/log/juicefs.log | grep '<INFO>'
$ cat /var/log/juicefs.log | grep '<WARNING>'
$ cat /var/log/juicefs.log | grep '<ERROR>'
$ cat /var/log/juicefs.log | grep '<FATAL>'

The .oplog virtual file in the mount directory

JuiceFS provides plain text file virtual files with .oplog and .ophistory files in the root directory of each mount point, outputing real-time file system operation logs.

  • .oplog outputs real-time operation logs
  • .ophistory also contains all the history logs since the log service started

Direct analysis of these log files can be difficult, but you can use our juicefs profile tool (For more detailed usage, please refer to Command Reference <profile>{.interpreted-text role="ref"} ).

The .stats virtual file in the mount directory

JuiceFS provides a plain-text virtual file with the file name .stats at the root of each mount point, reporting real-time statistics. It\'s helpful to look at the statistics in this file for troubleshooting and analysis. In this case, the file system mount point for fault diagnosis and analysis is assumed to be \jfs. Here is some helpful example commands:

View CPU and memory usage:

$ cat /jfs/.stats | grep usage

View uptime:

$ cat /jfs/.stats | grep uptime

View the count of each object storage operation:

$ cat /jfs/.stats | grep object

View the amount of object storage read and write data:

$ cat /jfs/.stats | grep _bytes