ErrorStack API

How so I submit errors to ErrorStack?

It's easy. Use our RESTful submit api to submit your errors to ErrorStack through an HTTP GET or POST request. We even have a Javascript example to get you started. Please send us your submission code for other languages and systems you use, and we'll post it here. Who know's you might become famous. :-)


Submit Your Sample Code

If you end up creating something cool or a better example than what we have here, let us know. We would love to see how you've made ErrorStack work for you. Your code could end up on this page as a shining example of your genius! (Ok, it's not like we're giving out Nobel prizes or anything, but we'll be sure to give you some props and maybe some cool ErrorStack swag.)


Submit (HTTP GET/POST Request)

Submits error information to a specified stack and returns a 1 pixel transparent .gif image.

Method(s): GET,POST

Example GET Call: (Formated on multiple lines for easy reading.)


Example POST HTML Form:
	<form action="" method="post">
	<input type="text" id="_s" name="_s" value="YOUR_STACK_KEY_GOES_HERE"/>
	<input type="text" id="_r" name="_r" value="json"/>
	<input type="text" id="Msg" name="Msg" value="Error loading script"/>
	<input type="text" id="URL" name="URL" value=""/>
	<input type="text" id="Line" name="Line" value="15"/>
	<input type="text" id="Platform" name="Platform" value="Win32"/>
	<input type="text" id="UserAgent" name="UserAgent" value="Mozilla/4.0%20(compatible; ...)"/>
	<input type="submit" value="Submit Error"/>


GET Example: Javascript AJAX Error Submission Code

This is an example of using the onerror function in javascript to submit javascript errors from any modern bowser. You can use this example as the basis for your submission code. The only required field is "s" (your stack key). Feel free to submit additional error detail you may need.

	onerror = function(msg,url,l){
		var txt="_s=YOUR_STACK_KEY_GOES_HERE&_r=img";
		var i = document.createElement("img");
		i.setAttribute("src", (("https:" == document.location.protocol) ? 
			"" : "") + "/submit?" + txt);


Log (HTTP GET/POST Request)

Need to track simple log messages while you're debuging some code? You can now submit them to this stack as a log message. Only the last 10 log messages are kept for a maximum of 1 hour. No clearing of old messages. Just log them to your stack and use them when you need them.

Logging messages works in the same way as submitting errors above.

Method(s): GET,POST


HTTPS (SSL) Support

If your webpage uses SSL to secure it's communication, you may have already noticed a pesky browser security message when you submit error messages to ErrorStack. The problem is with the browser warning the user that it's about to display non-SSL content. To fix this error you can submit error messages to our SSL endpoint. Just change the URL from "" to "".


Example Python Error Code

You can use the following python code to collect errors occurring in your python projects. For more information on submitting errors please visit our API page.

	import logging

	# Create a logger for your application and set level to ERROR
	logger = logging.getLogger("My_Python_App")

	# Define ErrorStack Handler
	import logging.handlers
	class ErrorStackHandler(logging.handlers.HTTPHandler):
	    def mapLogRecord(self, record):
	        """ Define the values submitted to """
	        keys = ['name','msg','levelname','module','pathname','funcName','lineno',
	        ErrorInfo = {}
	        for key in keys:
	            ErrorInfo[key] = record.__dict__[key]
	        return ErrorInfo

	# Create ErrorStack handler, set level to error, and add it to the logger
	ESHandler = ErrorStackHandler("", "/submit?_s=YOUR_STACK_KEY_GOES_HERE&_r=json", "POST")

	# Here are some examples of logging errors in your application code
	logger.error("I'm sorry Dave, I'm afraid I can't do that.", exc_info=True)
	    logger.critical("Houston, we have a problem.", exc_info=True)


Wordpress Plugin Information

You can use the ErrorStack Wordpress Plugin to collect errors occurring in your blog.
Steps to Install the Wordpress Plugin:

  1. Just download the plugin from:
  2. Upzip the file.
  3. Upload the ErrorStack.php file to your plugin directory (in /wp-content/plugins) on your webserver.
  4. Login to your Wordpress admin console, and go to the plugins page to activate the ErrorStack plugin.
  5. Goto the options page and find the ErrorStack options page.
  6. Enter the stackKey in the input box and hit Update.


ASP.NET Sample Code

For those websites using ASP.NET, we have a sample Global.asax that will allow you to submit errors to It's written in C# and uses the Application Error event to catch and submit errors. The sample code submits the error message, source, stack trace, and method from context.Server.GetLastError(). Download the sample code from:


Custom Stack Information

You can use the ErrorStack API to collect errors occurring in any system with Internet access and the ability to make an http connection. We suggest using the API documentation on this page, combined with the other examples as a basis for your custom error submission code.



You can use ErrorStack to report on Javascript errors that occur in the customer's browser running your Kynetx applications. You can define your stack key in the meta block of your application to automatically submit errors, use the built in KOBJ.errorstack_submit function for targeted error reporting, or submit custom errors by emitting the javascript submission code directly.

	<script type="text/javascript">
	onerror = function(msg,url,l){
		var txt="_s=&_r=img";
		var i = document.createElement("img");
		i.setAttribute("src", (("https:" == document.location.protocol) ? 
			"" : "") + "/submit?" + txt);
For more information, please visit


.Net/C# Sample Code

Harley Pebley has written a .Net wrapper around the ErrorStack API for submitting errors. Include his code in your source and call the log function to submit your errors. You can check out this open source library at:


iPhone Sample Code

Thanks to Evrhet Milam you can use the ErrorStack API to collect errors from the iPhone applications that you develop. The sample code contains a class to send the errors to ErrorStack. Just make a call to this class with your error name and reason (from NSExceptions.) The version of the iPhone platform and the version of your software are automatically included. To get started download the sample code from:


CodeIgniter Sample Code

Dan Olsen has written a library for the popular php framework CodeIgniter to track server side php errors. You can download the sample code from: or review the Installation or Usage Instructions.


Django Sample Code

Carl Meyer over at OddBird has put together a great Django integration that reports server side Django errors back to ErrorStack. You can easily install it from PyPI with easy_install or pip.

For more information visit the project repostitories at: