Skip to content

Logging API

v2rayroot edited this page Jun 14, 2026 · 1 revision

Logging API

Configure logging before starting the runtime.

SetLogOutput

void SetLogOutput(char *path);

Sets both Xray access and error log paths. The directory must exist and be writable. An empty path does not clear previous configuration.

SetLogLevel

void SetLogLevel(char *level);

Common levels:

  • debug
  • info
  • warning
  • error
  • none

Production Guidance

  • Prefer warning or error.
  • Rotate logs outside the library.
  • Restrict filesystem permissions.
  • Do not upload logs containing credentials or share URIs.
  • Record GetVersionInfo in sanitized support bundles.

Clone this wiki locally