Summary

The enableLogCollectorDebugLogging() mutation enables debug logging on a LogCollector at the collector level, affecting all instances registered under that collector. Use this mutation to diagnose ingestion failures, connectivity problems, or configuration issues across a LogCollector deployment. Debug logging increases log volume significantly; disable it after troubleshooting by calling disableLogCollectorDebugLogging(). To limit the scope to a single collector instance rather than all instances, use enableLogCollectorInstanceDebugLogging() instead.

Syntax

graphql
enableLogCollectorDebugLogging(
      url: String,
      token: String!,
      level: String!,
      repository: String
   ): Boolean!

The mutation requires token and level. The url and repository arguments are optional. The mutation returns a non-null Boolean!: true if debug logging was successfully enabled, false otherwise.

Example

Raw
graphql
mutation {
  enableLogCollectorDebugLogging(
      url: "https://lc.company.com", 
      token: "123abc456def789", 
      level: "high", 
      repository: "humio"
   )
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  enableLogCollectorDebugLogging(
      url: \"https://lc.company.com\", 
      token: \"123abc456def789\", 
      level: \"high\", 
      repository: \"humio\"
   )
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  enableLogCollectorDebugLogging(
      url: \"https://lc.company.com\", 
      token: \"123abc456def789\", 
      level: \"high\", 
      repository: \"humio\"
   )
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  enableLogCollectorDebugLogging( ^
      url: \"https://lc.company.com\",  ^
      token: \"123abc456def789\",  ^
      level: \"high\",  ^
      repository: \"humio\" ^
   ) ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  enableLogCollectorDebugLogging(
      url: \"https://lc.company.com\", 
      token: \"123abc456def789\", 
      level: \"high\", 
      repository: \"humio\"
   )
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "mutation {
  enableLogCollectorDebugLogging(
      url: \"https://lc.company.com\", 
      token: \"123abc456def789\", 
      level: \"high\", 
      repository: \"humio\"
   )
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  enableLogCollectorDebugLogging(
      url: \"https://lc.company.com\", 
      token: \"123abc456def789\", 
      level: \"high\", 
      repository: \"humio\"
   )
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  enableLogCollectorDebugLogging(
      url: \"https://lc.company.com\", 
      token: \"123abc456def789\", 
      level: \"high\", 
      repository: \"humio\"
   )
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "enableLogCollectorDebugLogging": true
  }
}

Input Parameters

The mutation requires the collector's token and a level string. The following table lists all input parameters:

Table: Input Parameters and Datatypes

Parameter Type Required Default Description
This table lists all input parameters for this mutation.
level string yes   The debug logging level to enable on the LogCollector. Accepted values are standard log levels such as DEBUG or TRACE. DEBUG produces verbose output covering internal state and data flow. TRACE is more verbose and may affect collector performance. Both levels increase log volume; disable debug logging after troubleshooting.
repository string     The name of the repository to scope debug logging to. When specified, debug log output is limited to events destined for that repository. When omitted, debug logging applies across all repositories handled by this collector.
token string yes   The authentication token assigned to the LogCollector. This token identifies which collector to target and is distinct from the API bearer token used in the HTTP Authorization header for the GraphQL request itself.
url string     The management endpoint URL of the LogCollector. When omitted, the server uses the URL registered for the collector identified by token. Provide this argument when the collector's registered URL differs from the target endpoint.