Skip to main content

General logs

General logs capture application and system information from across the Chef 360 Platform infrastructure. These logs include application events, system operations, service-level information, stdout/stderr output, and system events. Use general logs to troubleshoot application issues, monitor system health, analyze performance patterns, and understand service behavior across your infrastructure.

Prerequisites

Before you can access general logs, ensure that the Install admin token is configured during Chef 360 Platform Server installation. This token is required for authentication when retrieving general logs. For detailed instructions on configuring the install admin token, see API/UI settings.

List available services

List available services with the CLI

To discover available services before filtering logs, use the log-service general list-services subcommand:

chef-platform-auth-cli log-service general list-services \
  --pattern "<REGEX_PATTERN>" \
  --profile <PROFILE_NAME>

Replace the following:

  • <REGEX_PATTERN> (optional): The regex pattern to filter the service list, for example, chef-.*-service. Returns all services if not provided. Pattern matching is case-insensitive.
  • <PROFILE_NAME>: The name of the profile to use for authentication.

ist available services with the API

To retrieve a list of available services, use the following API command:

curl -X GET "https://<YOUR_DOMAIN>/api/log-service/general/list-services?pattern=<REGEX_PATTERN>" \
  -H "API-Key: <INSTALL_ADMIN_TOKEN>" \
  -H "API-Secret: <INSTALL_ADMIN_SECRET>"

Replace the following:

  • <YOUR_DOMAIN>: Your Chef 360 Platform domain, for example, chef-platform.example.com.
  • <REGEX_PATTERN> (optional): A regex pattern to filter service names, for example, chef-.*-service. Returns all services if not provided.
  • <INSTALL_ADMIN_TOKEN>: The install admin token for authentication.
  • <INSTALL_ADMIN_SECRET>: The install admin secret for authentication.

Access general logs

Note

You can retrieve a maximum of 3 hours of general log history in a single request. You can specify a maximum of 5 services for each request.

Access general logs using the CLI

Before using the CLI to access general logs, complete the following steps:

  1. Register and create a profile: Use the chef-platform-auth-cli register-device command to register with your Chef 360 Platform instance and create an authentication profile.

  2. Export the install admin token environment variable: Set the INSTALL_ADMIN_TOKEN environment variable with your install admin token value:

    export INSTALL_ADMIN_TOKEN=<YOUR_INSTALL_ADMIN_TOKEN>
    

To retrieve general service logs from Kubernetes containers across the platform, use the log-service general get-service-logs subcommand:

chef-platform-auth-cli log-service general get-service-logs \
  --services "<SERVICE_LIST>" \
  --from "<START_TIMESTAMP>" \
  --to "<END_TIMESTAMP>" \
  --order "<SORT_ORDER>" \
  --filter "<FILTER_CRITERIA>" \
  --file-name "<OUTPUT_FILE_PATH>" \
  --profile <PROFILE_NAME>

Replace the following:

  • <SERVICE_LIST> (required): A comma-separated list of service names to filter logs, for example, chef-platform-accounts,chef-node-management-service. You can specify a maximum of 5 services for each request. To get the list of available services, see List available services.
  • <START_TIMESTAMP> (optional): The start timestamp for log retrieval in ISO 8601 format, for example, 2025-10-09T10:00:00Z. Defaults to 1 hour ago.
  • <END_TIMESTAMP> (optional): The end timestamp for log retrieval in ISO 8601 format, for example, 2025-10-09T11:00:00Z. Defaults to the current time.
  • <SORT_ORDER> (optional): The sort order for log entries by timestamp. Use asc for oldest logs first or desc for newest logs first. Defaults to desc.
  • <FILTER_CRITERIA> (optional): Advanced filtering using field-value pairs with logical operators, for example, request-id:a1b2c3d4-e5f6-7890-abcd-ef1234567890,log-level:info. See Advanced filtering for detailed examples.
  • <OUTPUT_FILE_PATH> (optional): The path to the file to write the response body to, for example, service-logs.json. If not specified, the output is written to stdout.
  • <PROFILE_NAME>: The name of the profile to use for authentication.

Advanced filtering

The --filter parameter supports advanced filtering using field-value pairs with flexible logical operators:

  • Return all logs: Use an empty array [] or omit the parameter.
  • Single field filter: [{"request-id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"}] - Logs with request ID ‘a1b2c3d4-e5f6-7890-abcd-ef1234567890’.
  • Multiple values (OR logic): [{"request-id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890,f0e9d8c7-b6a5-4321-9876-543210fedcba"}] - Logs with request ID ‘a1b2c3d4-e5f6-7890-abcd-ef1234567890’ OR ‘f0e9d8c7-b6a5-4321-9876-543210fedcba’.
  • Multiple fields (AND logic): [{"request-id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"}, {"log-level": "info"}] - Logs with request ID ‘a1b2c3d4-e5f6-7890-abcd-ef1234567890’ AND log level ‘info’.
  • Complex combinations: [{"request-id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890,f0e9d8c7-b6a5-4321-9876-543210fedcba"}, {"log-level": "debug,info"}] - Logs with (request ID ‘a1b2c3d4-e5f6-7890-abcd-ef1234567890’ OR ‘f0e9d8c7-b6a5-4321-9876-543210fedcba’) AND (log level ‘debug’ OR ‘info’).

The filter supports any field name available in the log entries and returns an empty response if no logs match the criteria.

Access general service logs using the API

To retrieve general service logs, use the following API command:

curl -X GET "https://<YOUR_DOMAIN>/api/log-service/general?services=<SERVICE_LIST>&from=<START_TIMESTAMP>&to=<END_TIMESTAMP>&order=<SORT_ORDER>&filter=<FILTER_CRITERIA>" \
  -H "API-Key: <INSTALL_ADMIN_TOKEN>" \
  -H "API-Secret: <INSTALL_ADMIN_SECRET>"

Replace the following:

  • <YOUR_DOMAIN>: Your Chef 360 Platform domain, for example, chef-platform.example.com.
  • <SERVICE_LIST> (required): A comma-separated list of service names to filter logs, for example, chef-platform-accounts,chef-node-management-service. You can specify a maximum of 5 services for each request. To get the list of available services, see List available services.
  • <START_TIMESTAMP> (optional): The start timestamp in ISO 8601 format, for example, 2025-10-09T10:00:00Z. Defaults to 1 hour ago.
  • <END_TIMESTAMP> (optional): The end timestamp in ISO 8601 format, for example, 2025-10-09T11:00:00Z. Defaults to the current time.
  • <SORT_ORDER> (optional): The sort order for log entries. Use asc or desc. Defaults to desc.
  • <FILTER_CRITERIA> (optional): Advanced filtering criteria using field-value pairs, for example, request-id:a1b2c3d4-e5f6-7890-abcd-ef1234567890,log-level:info. See Advanced filtering for detailed examples. Returns all logs without filtering if not specified.
  • <INSTALL_ADMIN_TOKEN>: Install admin token for authentication.
  • <INSTALL_ADMIN_SECRET>: Install admin secret for authentication.

Troubleshooting

Advanced filtering returns an empty response

When using advanced filtering, if you receive an empty response, ensure that you’re using the correct field names in your filter criteria. For example, if you’re filtering by log level but receiving empty results, check if the field is named log-level, level, or another variant in the actual log entries.

To identify available field names:

  1. Retrieve logs without any filter for a single service and a minimal time frame.
  2. Examine the returned log entries to understand what fields are present in the log data.
  3. Use the correct field names from the actual log structure in your filter criteria.

Service list is required

If you receive an error indicating that the service list is required or missing, ensure that you specify the services parameter in your request. The service list is mandatory for all log download requests and can’t be omitted.

Use the List available services section to identify valid service names for your request.

Too many services specified

If you receive an error about exceeding the service limit, reduce the number of services in your request. You can specify a maximum of 5 services for each log download request. If you need logs from more than 5 services, make multiple requests with different service combinations.

Internal server error or gateway timeout

If you receive an internal server error or gateway timeout, the request might be too broad and is consuming excessive resources. To resolve this issue:

  • Reduce the time window for your log request, for example, from 3 hours to 1 hour.
  • Decrease the number of services in your request.
  • Add more specific filters to narrow down the logs you’re searching for, such as filtering by specific request IDs, log levels, or other relevant field values.

Service is currently busy

The error “Service is currently busy processing other streaming requests. Please try again later.” means that the log service is handling concurrent requests and has reached its processing capacity. To resolve this issue, wait for 5 minutes and then retry your request.

More information

Thank you for your feedback!

×