stdout.online Dark mode

Start a logging session
What's this?

This website provides a way to send arbitrary text to the browser from any program with zero setup.


How do I use it?

Click on the "Start logging" button above, open "Get code snippet", copy a snippet, and run it anywhere in your program. The output will show up in your browser.


How does it work?

The snippet you can open from "Get code snippet" sends a request to the configured /log endpoint. Your browser stays connected to the logging server over WebSocket and only receives messages for the current session id. The maximum number of logged messages is 1000. After reaching this limit the oldest messages will be deleted as new messages arrive. If you want to keep a message, you can pin it. Refreshing the page will clear all messages with no way to recover them.


Is it safe?

No. You should not use it for any sensitive data for two reasons:

  • Anyone who guesses your session id can see your log output and you won't know about it.
  • Any data you send to the logging server may end up in logs and memory dumps. Having said that, nothing is intentionally stored on the server.

y tho

This is the kind of tool which I "shouldn't" need, but nevertheless over the years I found myself in situations where it would have been a godsend. On multiple occasions I urgently needed to debug something but I didn't have a quick way to output stuff - maybe I didn't have ssh access, maybe the script ran in the background and the output was redirected to /dev/null, maybe logging was not injected in the class I was looking at... In each case it probably only took a few minutes to find a workaround, but that was valuable time I would have preferred to spend actually debugging. What I needed was to be able to just paste a one-liner literally anywhere in the code to output any value I wanted. So I decided to write an app that allows me to do just that.


Choose your programming language and use a short standard-library-only snippet to send log messages to this window.

Close
function stdout_online($m){file_get_contents('{%%ingestUrl%%}',false,stream_context_create(['http'=>['method'=>'POST','header'=>"Content-Type: application/json\r\n",'content'=>json_encode(['s'=>'{%%sessionId%%}','m'=>$m])]]));}
stdout_online('Your message goes here');
Copy code snippet
import json, urllib.request; stdout_online=lambda m: urllib.request.urlopen(urllib.request.Request('{%%ingestUrl%%}', data=json.dumps({'s':'{%%sessionId%%}','m':m}).encode(), headers={'Content-Type':'application/json'}))
stdout_online("Your message goes here")
Copy code snippet
require 'net/http';require 'json';stdout_online=->(m){Net::HTTP.post(URI('{%%ingestUrl%%}'),{'s'=>'{%%sessionId%%}','m'=>m}.to_json,'Content-Type'=>'application/json')}
stdout_online.call('Your message goes here')
Copy code snippet
const stdoutOnline=m=>fetch('{%%ingestUrl%%}',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({s:'{%%sessionId%%}',m})});
stdoutOnline('Your message goes here');
Copy code snippet

Paste inside a method or block.

java.util.function.Consumer<String> stdoutOnline=m->java.net.http.HttpClient.newHttpClient().sendAsync(java.net.http.HttpRequest.newBuilder(java.net.URI.create("{%%ingestUrl%%}")).header("Content-Type","application/json").POST(java.net.http.HttpRequest.BodyPublishers.ofString("{\"s\":\"{%%sessionId%%}\",\"m\":\""+m.replace("\\","\\\\").replace("\"","\\\"")+"\"}")).build(),java.net.http.HttpResponse.BodyHandlers.discarding()).join();
stdoutOnline.accept("Your message goes here");
Copy code snippet

Requires imports: bytes, encoding/json, net/http.

stdoutOnline:=func(m string){b,_:=json.Marshal(map[string]string{"s":"{%%sessionId%%}","m":m});http.Post("{%%ingestUrl%%}","application/json",bytes.NewReader(b))}
stdoutOnline("Your message goes here")
Copy code snippet
System.Func<string,System.Net.HttpStatusCode> stdoutOnline=m=>new System.Net.Http.HttpClient().PostAsync("{%%ingestUrl%%}",new System.Net.Http.StringContent(System.Text.Json.JsonSerializer.Serialize(new{s="{%%sessionId%%}",m}),System.Text.Encoding.UTF8,"application/json")).GetAwaiter().GetResult().StatusCode;
stdoutOnline("Your message goes here");
Copy code snippet
curl -X POST '{%%ingestUrl%%}' -H 'Content-Type: application/json' \
  -d '{"s":"{%%sessionId%%}","m":"Your message goes here"}'
Copy code snippet
Log frozen. All new messages are ignored. Discarded messages: 0.