Skip to main content

Logging

Log Destination

This option allows the user to set the destination for logging. The value of ‘log_destination’ global configuration option can have one of the following mutually exclusive destinations:

  • console– Prints messages to ‘stdout’ and to ‘stderr ’ in case of an error.
  • syslog – Sends messages to the system’s syslog.
  • file – Records messages to a file.

Each log message consists of two parts: ‘log-metadata’ and ‘log-content’.

‘log-metadata’ may contain any of the following components (please refer to section Log Parameters for details on configuring the components) :

  • Timestamp of the message in RFC 3339 format. The timestamp can have microsecond resolution and timezone.
  • The ID of thread printing this message.
  • The severity level of the message.
  • Name of a module or topic from where the message is printed.
note

‘log-metadata’ is not a mandatory field.

‘log-content’ is the content of the message to be printed.

Default:

log_destination = console

Log Level

This option allows to specify the severity of the events to be logged. The supported severity levels are:

  • ‘0’ – None (no logging)
  • ‘1’ – Critical (error that might prevent software from running)
  • ‘2’ – Error (condition preventing software from performing certain operations)
  • ‘3’ – Warning (indicating an unexpected event)
  • ‘4’ – Information (logs confirming the state of an operation)
  • ‘5’ – Debug (messages for developers for debugging) The levels defined in Fusion File Share are very similar to the severity levels defined for syslog in RFC5424.

Level ‘5’ is not available for normal users and is only available in debug/developer builds of Fusion File Share.

If this option is not explicitly specified, then Fusion File Share uses level ‘3’ as default.

Default:

log_level = 3

Log Parameters

This option allows to specify parameters required for logging. It accepts a list of parameters separated by comma ‘ , ’.

The supported parameters are:

  • ‘ path=<path/to/file >’

    The path to a file to be used for logging a message. This parameter is mandatory when ‘log_destination = file’ is specified.

  • ‘long’

    Disable truncating each message in a log and print the entire log message. If this parameter is not configured then each component of a log message is truncated. ‘Log-metadata’ is truncated to a maximum of 80 characters. ‘Log-content’ is truncated to a maximum of 256 characters plus any bytes unused by ‘log-metadata’ component. So any message would occupy a maximum of 337 bytes (80 + 256 + a newline character). If the user observes that the logs are truncated, then enabling this option will print the entire log message. Enabling this option can incur some performance penalty.

    Disabled by default.

  • ‘timestamp’ Whether the log-metadata will include timestamps in RFC 3339 format: [YYYY-MM-DD HH:MM:SS].

    Disabled by default.

  • ‘time_usec’ Whether the timestamp will include timestamps with microsecond resolution.

    Enabled by default.

  • ‘tid’

    Whether the log-metadata will include the thread ID of the context logging a message.

    Disabled by default.

  • ‘trace’

    Whether to enable tracing when printing log messages. This option provides additional info to the log-metadata such as:

    • Function name
    • Line number
    note

    This option is only available in debug/developer builds.

  • ‘sensitive_data=<value>’

    Whether to allow sensitive data to appear in the log message. “Sensitive” data is the data that the user does not want to disclose such as domain names, IP addresses, user names, and file paths, especially when sharing the log messages with third parties.

    The possible values are:

    • ‘allow’ – The data appears as-is.
    • ‘strip’ – The data is replaced with string ‘***’.
    • ‘hash’ – The data is replaced with its hash value. This allows hiding data but the log is still easier to analyze since same entities have the same hash.

Example:

log_params = long,timestamp,sensitive_data=hash