Php sdk
Development Mode
Use the console transport for local development with the VedaTrace PHP SDK.
For local development, VedaTrace provides a built-in console transport that outputs logs directly to stdout. This allows you to verify your logs without sending them to the VedaTrace API.
Configuring Console Transport
To use development mode, set the transport configuration option to console:
$logger = VedaTrace\VedaTrace::create([
'transport' => 'console',
'prettyPrint' => true, // Human-readable output
]);
$logger->info('Local log message');Pretty Printing
Pretty printing provides a formatted, easy-to-read layout for your logs on the terminal. By default, it uses simple text output. When prettyPrint is false, it outputs logs as raw JSON strings.
Environment Variables
You can also use environment variables to control development mode:
export VEDATRACE_TRANSPORT=console
export VEDATRACE_PRETTY_PRINT=trueThe configuration logic automatically picks up these values if they are not explicitly set in the initialization array.
