Skip to content

Logging

James Fantin-Hardesty edited this page Oct 17, 2023 · 4 revisions

Overview

Here are the configuration options applicable to logging.

Output Locations

Cloudfuse supports 2 different types of log outputs, syslog which writes data to syslog on Linux and the Event Viewer on Windows and base which writes data to the output location of your choosing.

If using syslog on Linux, simply grep for cloudfuse:

grep cloudfuse /var/log/syslog

If using syslog on Windows, look for the 'Cloudfuse' application in the Windows Event Viewer.

The default logging type is syslog.

Syslog security warning

By default, Cloudfuse will log to syslog. The default settings will, in some cases, log relevant file paths to syslog. If this is sensitive information, turn off logging or set log-level to LOG_ERR.

Level

Cloudfuse supports five levels of severity:

log_off|log_crit|log_err|log_warning|log_info|log_trace|log_debug

  1. LOG_OFF - Shuts off logging completely.

  2. LOG_CRIT - Issues that cause cloudfuse to fail to start.

  3. LOG_ERR - Issues that will end up returning errors to the caller. For example, if you write some data and then try to close the file handle, but cloudfuse fails (for whatever reason) to properly connect to Azure Storage to commit the data, this event will be logged at level LOG_ERR (as well as returning a failure to the process attempting to close the file handle, of course.)

  4. LOG_WARNING - Issues that cloudfuse encounters that may not be actual errors, but still may be valuable to log. For example, if a network operation fails but is retriable, a warning may be logged before automatic retries kick in.

  5. LOG_INFO - All operations relating to the uploading or downloading of blob data to Azure Storage are logged at LOG_INFO level. Some other operations are also logged at the level, that may be informative if problems are encountered.

  6. LOG_TRACE - Essentially trace statements for all calls into cloudfuse. This is very verbose, and contains helpful debugging information such as line number, method name, method inputs and return values, etc. Probably only helpful if you are looking at the source code as well.

  7. LOG_DEBUG - Contains additional helpful debugging information.

The default log level is LOG_WARNING. You can set the log level when you mount Cloudfuse by

a. adding the CLI parameter: --log-level=LOG_OFF|LOG_CRIT|LOG_ERR|LOG_WARNING|LOG_INFO|LOG_TRACE|LOG_DEBUG

b. specifying the config file parameter logging.level: LOG_OFF|LOG_CRIT|LOG_ERR|LOG_WARNING|LOG_INFO|LOG_TRACE|LOG_DEBUG

LOG_OFF will shut off logging completely (specifically, it sets the log threshold for the process to LOG_EMERG, which we do not use.) Other options include all worse levels of severity (meaning, if you specify LOG_INFO, cloudfuse will log all INFO, WARNING, ERR, and CRIT level messages.)

Libfuse Logging

libfuse library provides a '-d' option in mount command to enable its verbose logging on the console. This will enable debug logs in the library and print all system calls being made along with their return values on the console itself.

Alternatively, enable libfuse logging by specifying the config file parameter libfuse.fuse-trace: true

Azure SDK Logging

If the logs indicate that the issue is coming from the Azure storage SDK, enable SDK logging to get detailed logs of the REST calls to be able to diagnose whether an issue is in cloudfuse, SDK or service side. Azure SDK logging can be enabled by specifying the config file parameter azstorage.sdk-trace: true

Syslog Redirection

By default cloudfuse dumps its logs in /var/log/syslog file. To redirect logs to a separate file follow below instructions. Files required for these commands are part of the package or can be found in the source code under 'systemd' directory.

- copy setup/11-cloudfuse.conf to /etc/rsyslog.d/

- copy setup/cloudfuse-logrotate to /etc/logrotate.d/

- restart rsyslog service

    - $> service rsyslog restart

Dynamic Logging

Default logging level of cloudfuse is LOG_WARNING. User can set a different log level using the --log-level CLI parameter or the logging.level config file parameter. Once cloudfuse is mounted if a customer is using a config file, this logging level can be changed without unmounting the container. Modify the logging.level parameter in the config file and save the config file to dynamically update the log level.