From 5d5ee0d82eb1a2d679b087e804a304a7120035ac Mon Sep 17 00:00:00 2001 From: Joe Reuss Date: Fri, 12 Jan 2024 16:16:27 -0600 Subject: [PATCH] Xrootd log levels now configurable Moves many of the xrootd log levels to be configurable. Set defaults in defaults.yaml to what we previously had set. --- config/resources/defaults.yaml | 9 ++++ docs/parameters.yaml | 68 ++++++++++++++++++++++++++++++ param/parameters.go | 9 ++++ param/parameters_struct.go | 18 ++++++++ xrootd/resources/xrootd-cache.cfg | 12 +++--- xrootd/resources/xrootd-origin.cfg | 8 ++-- xrootd/xrootd_config.go | 21 +++++++-- 7 files changed, 131 insertions(+), 14 deletions(-) diff --git a/config/resources/defaults.yaml b/config/resources/defaults.yaml index 0bb477752..45c902507 100644 --- a/config/resources/defaults.yaml +++ b/config/resources/defaults.yaml @@ -17,6 +17,15 @@ Debug: false Logging: Level: "Error" + XrootdScitokensTrace: all + XrootdPssTrace: all + XrootdCmsTrace: all + XrootdOfsTrace: all + XrootdPfcTrace: info + XrootdXrdTrace: all -sched + XrootdXrootdTrace: emsg login stall redirect + XrootdPssSetOptCache: DebugLevel 3 + XrootdPssSetOptOrigin: DebugLevel 1 Server: WebPort: 8444 WebHost: "0.0.0.0" diff --git a/docs/parameters.yaml b/docs/parameters.yaml index d12663f63..451599838 100644 --- a/docs/parameters.yaml +++ b/docs/parameters.yaml @@ -148,6 +148,74 @@ type: filename default: none components: ["*"] --- +name: Logging.XrootdPssSetOptOrigin +description: >- + Configures the XRootD client used by the proxy top communicate with the origin (we use to set debug level). + Values include: DebugLevel (0, 1, 2, 3) +type: string +default: DebugLevel 1 +components: ["cache"] +--- +name: Logging.XrootdPssSetOptCache +description: >- + Configures the XRootD client used by the proxy top communicate with the cache (we use to set debug level). + Values include: DebugLevel (0, 1, 2, 3) +type: string +default: DebugLevel 3 +components: ["cache"] +--- +name: Logging.XrootdPssTrace +description: >- + Logging level of pss within Xrootd configuration values include: all, on, debug +type: string +default: all +components: ["cache"] +--- +name: Logging.XrootdScitokensTrace +description: >- + Trace level of scitokens debug output within Xrootd configuration. Values include: all, on, debug +type: string +default: all +components: ["origin", "cache"] +--- +name: Logging.XrootdCmsTrace +description: >- + Trace level of cms debug output within Xrootd configuration. Values include: all, debug, defer, files, forward, redirect, space, stage +type: string +default: all +components: ["cache"] +--- +name: Logging.XrootdOfsTrace +description: >- + Trace level of ofs debug output within Xrootd configuration. Values include: aio, all, chmod, close, closedir, debug, delay, dir, exists, + fsctl, getstats, io, mkdir, most, open, opendir, qscan, read, readdir, redirect, remove, rename, sync, truncate, write +type: string +default: all +components: ["cache"] +--- +name: Logging.XrootdPfcTrace +description: >- + Trace level of pfc debug output within Xrootd configuration. Values include: none, error, warning, info, debug, dump +type: string +default: info +components: ["origin"] +--- +name: Logging.XrootdXrootdTrace +description: >- + Trace options for Xrootd debug output within Xrootd configuration. Values include: all, auth, debug, emsg, fs, fsaio, fsio, login, mem, off, + pgcserr, redirect, request, response, stall +type: string +default: emsg login stall redirect +components: ["origin"] +--- +name: Logging.XrootdXrdTrace +description: >- + Trace options for Xrootd debug output (xrd) within Xrootd configuration. Values include: all, conn, debug, mem, net, none, off, poll, protocol, + sched, tls, tlsctx, tlsio, tlssok +type: string +default: all -sched +components: ["cache"] +--- ############################ # Federation-Level Configs # ############################ diff --git a/param/parameters.go b/param/parameters.go index e793442f9..fcdccacc9 100644 --- a/param/parameters.go +++ b/param/parameters.go @@ -79,6 +79,15 @@ var ( Issuer_TomcatLocation = StringParam{"Issuer.TomcatLocation"} Logging_Level = StringParam{"Logging.Level"} Logging_LogLocation = StringParam{"Logging.LogLocation"} + Logging_XrootdCmsTrace = StringParam{"Logging.XrootdCmsTrace"} + Logging_XrootdOfsTrace = StringParam{"Logging.XrootdOfsTrace"} + Logging_XrootdPfcTrace = StringParam{"Logging.XrootdPfcTrace"} + Logging_XrootdPssSetOptCache = StringParam{"Logging.XrootdPssSetOptCache"} + Logging_XrootdPssSetOptOrigin = StringParam{"Logging.XrootdPssSetOptOrigin"} + Logging_XrootdPssTrace = StringParam{"Logging.XrootdPssTrace"} + Logging_XrootdScitokensTrace = StringParam{"Logging.XrootdScitokensTrace"} + Logging_XrootdXrdTrace = StringParam{"Logging.XrootdXrdTrace"} + Logging_XrootdXrootdTrace = StringParam{"Logging.XrootdXrootdTrace"} Monitoring_DataLocation = StringParam{"Monitoring.DataLocation"} OIDC_AuthorizationEndpoint = StringParam{"OIDC.AuthorizationEndpoint"} OIDC_ClientID = StringParam{"OIDC.ClientID"} diff --git a/param/parameters_struct.go b/param/parameters_struct.go index 37c9bfdd7..b99e40b0c 100644 --- a/param/parameters_struct.go +++ b/param/parameters_struct.go @@ -59,6 +59,15 @@ type config struct { Logging struct { Level string LogLocation string + XrootdCmsTrace string + XrootdOfsTrace string + XrootdPfcTrace string + XrootdPssSetOptCache string + XrootdPssSetOptOrigin string + XrootdPssTrace string + XrootdScitokensTrace string + XrootdXrdTrace string + XrootdXrootdTrace string } MinimumDownloadSpeed int Monitoring struct { @@ -223,6 +232,15 @@ type configWithType struct { Logging struct { Level struct { Type string; Value string } LogLocation struct { Type string; Value string } + XrootdCmsTrace struct { Type string; Value string } + XrootdOfsTrace struct { Type string; Value string } + XrootdPfcTrace struct { Type string; Value string } + XrootdPssSetOptCache struct { Type string; Value string } + XrootdPssSetOptOrigin struct { Type string; Value string } + XrootdPssTrace struct { Type string; Value string } + XrootdScitokensTrace struct { Type string; Value string } + XrootdXrdTrace struct { Type string; Value string } + XrootdXrootdTrace struct { Type string; Value string } } MinimumDownloadSpeed struct { Type string; Value int } Monitoring struct { diff --git a/xrootd/resources/xrootd-cache.cfg b/xrootd/resources/xrootd-cache.cfg index 30897d27d..9bb9d69ed 100644 --- a/xrootd/resources/xrootd-cache.cfg +++ b/xrootd/resources/xrootd-cache.cfg @@ -64,9 +64,9 @@ oss.localroot {{.Cache.DataLocation}} #oss.space meta {{.Cache.DataLocation}}/meta* #oss.space data {{.Cache.DataLocation}}/data* pss.debug -pss.setopt DebugLevel 3 -pss.trace all -ofs.trace all -xrd.trace all -sched -cms.trace all -scitokens.trace all +pss.setopt {{.Logging.XrootdPssSetOptCache}} +pss.trace {{.Logging.XrootdPssTrace}} +ofs.trace {{.Logging.XrootdOfsTrace}} +xrd.trace {{.Logging.XrootdXrdTrace}} +cms.trace {{.Logging.XrootdCmsTrace}} +scitokens.trace {{.Logging.XrootdScitokensTrace}} diff --git a/xrootd/resources/xrootd-origin.cfg b/xrootd/resources/xrootd-origin.cfg index 7cd3c99a2..6cfed7148 100644 --- a/xrootd/resources/xrootd-origin.cfg +++ b/xrootd/resources/xrootd-origin.cfg @@ -83,8 +83,8 @@ ofs.osslib libXrdMultiuser.so default ofs.ckslib * libXrdMultiuser.so {{end}} xrootd.chksum max 2 md5 adler32 crc32 -xrootd.trace emsg login stall redirect -pfc.trace info -pss.setopt DebugLevel 1 +xrootd.trace {{.Logging.XrootdXrootdTrace}} +pfc.trace {{.Logging.XrootdPfcTrace}} +pss.setopt {{.Logging.XrootdPssSetOptOrigin}} xrootd.tls all -scitokens.trace all +scitokens.trace {{.Logging.XrootdScitokensTrace}} diff --git a/xrootd/xrootd_config.go b/xrootd/xrootd_config.go index 2b7b1abb7..c7a78a025 100644 --- a/xrootd/xrootd_config.go +++ b/xrootd/xrootd_config.go @@ -112,11 +112,24 @@ type ( TLSCACertificateFile string } + LoggingConfig struct { + XrootdScitokensTrace string + XrootdPssTrace string + XrootdCmsTrace string + XrootdOfsTrace string + XrootdPfcTrace string + XrootdXrootdTrace string + XrootdXrdTrace string + XrootdPssSetOptCache string + XrootdPssSetOptOrigin string + } + XrootdConfig struct { - Server ServerConfig - Origin OriginConfig - Xrootd XrootdOptions - Cache CacheConfig + Server ServerConfig + Origin OriginConfig + Xrootd XrootdOptions + Cache CacheConfig + Logging LoggingConfig } )