SystemOutput, writing to the console

edit

Function SystemOutput

SystemOutput() is like <cfdump> for your console - supports complex types. Visible in Docker logs.

Browser vs Console

dump(cgi); // browser output (or writeDump if you love to write more)
echo(now()); // browser output (or writeOutput if you love to write more)
systemOutput(cgi, true); // console output
systemOutput(now(), true); // console output

New Line

systemOutput(now(), true); // with new line

Second argument true adds a newline.

Error Stream

systemOutput(now(), true, true); // send to error stream

Third argument true writes to stderr instead of stdout.

Complex Objects

systemOutput(cgi, true); // complex object

Outputs serialized representation of structs, queries, etc.

Stack Trace

systemOutput("Here we are:<print-stack-trace>", true);

The <print-stack-trace> placeholder outputs the current stack trace.

Video: Function SystemOutput

See also