English

Contributors ciarm Download PDF of this page

Logging for NFS and SMB (optional)

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

Error! Reference source not found.

NA

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

false

This boolean option is used to enable event messaging. Setting it 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 will hide sensitive information (IP and username) in the messages going to support (logging, events, syslog, etc.)
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 you want to enable, change the isEnabled value to true.

  4. Name the file xcpLogConfig.json and sae it to the file location mentioned in Error! Reference source not found.

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
}