Skip to main content
XCP

Logging for NFS and SMB (optional)

Contributors netapp-aoife netapp-pcarriga netapp-barbe ciarm

Logging for XCP NFS and SMB.

XCP supports configuring multiple optional features by using the xcpLogConfig.json JSON configuration file. To enable only specific features, manually create the xcpLogConfig.json configuration file. You can use the xcpLogConfig.json configuration file to enable:

  • event log messages

  • syslog client for XCP

  • custom XCP logging

Event log messages and the syslog client are disabled in the default configuration. Configuration is common for both NFS and SMB.

Config JSON file location NFS SMB

Config file default location

/opt/NetApp/xFiles/xcp/

C:\NetApp\XCP\ConfigFile

Custom location requires the XCP_CONFIG_DIR environment variable

Use the location you have set against the XCP_CONFIG_DIR variable

N/A

The JSON configuration file options are case sensitive. These options are the same for XCP NFS and XCP SMB.

Sub options name JSON data type Default Description

logConfig

Option to customize XCP logging.

“level”

String

INFO

Log message severity filter level.
XCP log messages support five severity levels in order of decreasing severity:
CRITICAL, ERROR, WARNING, INFO, DEBUG
(NetApp strongly recommends using INFO or DEBUG)

“maxBytes”

Integer

52428800

Size of each rotating log file. Max supported rotation files are 10.

“name”

String

xcp.log

Option to set custom log file name.

eventlog

Option to configure event log message.

“isEnabled”

Boolean

true

This boolean option is used to enable event messaging. Setting it to false will not generate any event messages and no event logs will be published to event log file.

“level”

String

INFO

Event message severity filter level.
Event messaging support five severity levels in order of decreasing severity:
CRITICAL, ERROR, WARNING, INFO, DEBUG

syslog

Option to configure syslog messaging.

“isEnabled”

Boolean

false

This boolean option is used to enable syslog client in XCP.

“level”

String

INFO

Message severity filter level.
XCP event log messages support five severity levels in order of decreasing severity:
CRITICAL, ERROR, WARNING, INFO, DEBUG

“serverIp”

String

None

Remote syslog server IP addresses or hostname.

“port”

Integer

514

Remote syslog receiver port.
Syslog receivers accepting syslog datagrams on a different port can be configured with port option UDP port 514 but you can also configure to the desired port.

“sanitize”

Boolean

false

A common option for XCP support; setting its value to true hides sensitive information (IP and username) in the messages going to support (logging, events, syslog, and so on).
For example, with the sanitize option as false:
* 2020-07-17 03:10:23,779 - INFO - 12806 xcp xcp Paths: ['10.234.104.251:/cat_vol']
* 2020-07-17 03:10:23,778 - INFO - 12806 xcp xcp User Name: root
With the sanitize option as true:
* 2020-07-17 03:13:51,596 - INFO - 12859 xcp xcp Paths: ['IP: XX.XX.XX.XX:/cat_vol']
* 2020-07-17 03:13:51,595 - INFO - 12859 xcp xcp User Name: * * *

Create the JSON configuration file

If you want to enable event log messages, the syslog client, or customer logging, complete the following steps.

Steps
  1. Open any text editor, such as notepad or vi.

  2. Create a new file with the following JSON template.

    {
      "logConfig": {
        "level": "INFO",
        "maxBytes": 52428800,
        "name": "xcp.log"
      },
      "eventlog": {
        "isEnabled": false,
        "level": "INFO"
      },
      "syslog": {
        "isEnabled": false,
        "level": "INFO",
        "serverIp": "10.234.219.87",
        "port": 514
      },
      "sanitize": false
    }
  3. For any features that you want to enable, change the isEnabled value to true.

  4. Name the file xcpLogConfig.json and save it to the default location: /opt/NetApp/xFiles/xcp/

    If the XCP_CONFIG_DIR environment variable is set, save the xcpLogConfig.json file in the same location that is set against the XCP_CONFIG_DIR variable.

Default configuration Example json configuration file
{
  "logConfig": {
    "level": "INFO",
    "maxBytes": 52428800,
    "name": "xcp.log"
  },
  "sanitize": false
}
{
  "logConfig": {
    "level": "INFO",
    "maxBytes": 52428800,
    "name": "xcp.log"
  },
  "eventlog": {
    "isEnabled": false,
    "level": "INFO"
  },
  "syslog": {
    "isEnabled": false,
    "level": "INFO",
    "serverIp": "10.234.219.87",
    "port": 514
  },
  "sanitize": false
}