{"id":32117,"date":"2014-11-03T01:00:28","date_gmt":"2014-11-02T23:00:28","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=32117"},"modified":"2014-11-02T13:26:50","modified_gmt":"2014-11-02T11:26:50","slug":"server-side-logging-from-browser-side-javascript-code","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html","title":{"rendered":"Server side logging from browser side JavaScript code"},"content":{"rendered":"<p>Application logging is something we all do in our applications that get deployed on an application server, right? Using frameworks like Log4J or Logback seems like a no-brainer to most Java developers. But what about the code we\u2019ve written that is running in those pesky browsers? I guess that, apart from the occasional <em>console.log()<\/em> statement used during debugging, we don\u2019t give much thought to JavaScript logging. I find this situation very regrettable since nowadays the trend appears to be to move our application logic to the browser. And with it, interesting events happening in the browser might go unnoticed, or any bugs that will happen, no matter how well we\u2019ve developed and tested our client side code, might prove needlessly hard to reproduce and therefore fix. In this blog post I\u2019ll demonstrate a very basic setup to log messages from the browser on the server using some very basic JavaScript with jQuery, and a simple Spring controller with Slf4J.<\/p>\n<h2>Server side code<\/h2>\n<p>Assuming you already have an existing Spring web application up and running and are using SLF4J for your application logging, all we have to do is add an additional @Controller that will take care of logging any incoming messages.<\/p>\n<p><em>Our JSLogger controller<\/em><\/p>\n<pre class=\"brush:java;wrap-lines:false\">package it.jdev.demo;\r\n\r\nimport java.lang.invoke.MethodHandles;\r\n\r\nimport javax.servlet.http.HttpServletRequest;\r\n\r\nimport org.slf4j.Logger;\r\nimport org.slf4j.LoggerFactory;\r\nimport org.springframework.http.HttpStatus;\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.web.bind.annotation.RequestBody;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.bind.annotation.ResponseStatus;\r\n\r\n@Controller\r\n@RequestMapping(value = \"\/js-log\")\r\npublic class JSLogger {\r\n\r\n    private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.Lookup.class);\r\n\r\n    @RequestMapping(method = RequestMethod.POST)\r\n    @ResponseStatus(HttpStatus.NO_CONTENT)\r\n    public void logError(final HttpServletRequest request, @RequestBody(required = true) final String logMessage) {\r\n        final String ipAddress = request.getRemoteAddr();\r\n        final String hostname = request.getRemoteHost();\r\n        LOGGER.warn(\"Received client-side logmessage (\" + ipAddress + \"\/\" + hostname + \"): \" + logMessage);\r\n    }\r\n\r\n}<\/pre>\n<h2>JavaScript code<\/h2>\n<p>For the JavaScript part of our logging solution we\u2019ll add a JS file called <em>jdev.js<\/em>. In it we\u2019ll define a module named <em>JDEV.logging<\/em> that will contain a method called <em>logToServer()<\/em>. This method will send an Ajax message to our controller with a little bit of help from jQuery. Just make sure that the <em>url<\/em> variable points to the endpoint configured in our controller\u2019s @RequestMapping.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><em>Our JavaScript logging module<\/em><\/p>\n<pre class=\"brush:java\">var JDEV = JDEV || {};\r\n\r\n\r\nJDEV.namespace = function(ns_string) {\r\n\tvar parts = ns_string.split('.');\r\n\tvar parent = JDEV;\r\n\r\n\t\/\/ strip redundant leading global\r\n\tif (parts[0] === \"JDEV\") {\r\n\t\tparts = parts.slice(1);\r\n\t}\r\n\tfor (var i = 0; i < parts.length; i += 1) {\r\n\t\t\/\/ create a property if it doesn't exist\r\n\t\tif (typeof parent[parts[i]] === \"undefined\") {\r\n\t\t\tparent[parts[i]] = {};\r\n\t\t}\r\n\t\tparent = parent[parts[i]];\r\n\t}\r\n\treturn parent;\r\n};\r\n\r\n\r\nJDEV.namespace('logging');\r\nJDEV.logging = (function() {\r\n\r\n\tvar logToServer = function(logMessage) {\r\n\t\tvar logEventObject = {\r\n\t\t\t\"message\" : logMessage,\r\n\t\t\t\"location\" : location.href,\r\n\t\t\t\"browser\" : navigator.userAgent,\r\n\t\t};\r\n\t\tvar logMsg = JSON.stringify(logEventObject);\r\n\t\tvar url = \"js-log\";\r\n\t\t$.ajax({\r\n\t\t\ttype : \"POST\",\r\n\t\t\turl : url,\r\n\t\t\tdata : logMsg,\r\n\t\t\tcontentType : \"application\/json\",\r\n\t\t\tcache : \"false\",\r\n\t\t});\r\n\t}\r\n\t\r\n\treturn {\r\n\t\tlogToServer : logToServer,\r\n\t}\r\n\r\n})();<\/pre>\n<p>All that is left to do, is include jQuery and our jdev.js file in our html pages, and instead of calling console.log() use our new logging method:<\/p>\n<p><em>Wiring up the JS code<\/em><\/p>\n<pre class=\"brush:xml\">\t&lt;script src=\"\/\/code.jquery.com\/jquery-1.11.0.min.js\"&gt;&lt;\/script&gt;\r\n\t&lt;script type=\"text\/javascript\" src=\"js\/jdev.js\"&gt;&lt;\/script&gt;\r\n\t&lt;script type=\"text\/javascript\"&gt;\r\n\t\t$(document).ready(function() {\r\n\t\t    JDEV.logging.logToServer(\"Hi from the browser...\");\r\n\t\t});\r\n\t&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>If everything is set up correctly, you should wind up with a similar log entry:<br \/>\n<code>WARN : Received client-side logmessage (127.0.0.1\/localhost): {\"message\":\"Hi from the browser...\",\"location\":\"http:\/\/localhost:8080\/demo\/\",\"browser\":\"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/38.0.2125.104 Safari\/537.36\"}<\/code><\/p>\n<h2>Wrapping up<\/h2>\n<p>I\u2019ve demonstrated a very simple design making it possible to log entries in your server side log that originate from browser side JavaScript code. Of course, you can elaborate on this example, e.g. by adding the possibility to send along the Log Level with the Ajax call.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/www.jdev.it\/server-side-logging-browser-side-javascript-code\/\">Server side logging from browser side JavaScript code<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\/\">JCG partner<\/a> Wim van Haaren at the <a href=\"http:\/\/www.jdev.it\/blog\/\">JDev<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Application logging is something we all do in our applications that get deployed on an application server, right? Using frameworks like Log4J or Logback seems like a no-brainer to most Java developers. But what about the code we\u2019ve written that is running in those pesky browsers? I guess that, apart from the occasional console.log() statement &hellip;<\/p>\n","protected":false},"author":596,"featured_media":20900,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[803,209,30],"class_list":["post-32117","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-javascript","tag-jquery","tag-spring"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Server side logging from browser side JavaScript code<\/title>\n<meta name=\"description\" content=\"Application logging is something we all do in our applications that get deployed on an application server, right? Using frameworks like Log4J or Logback\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Server side logging from browser side JavaScript code\" \/>\n<meta property=\"og:description\" content=\"Application logging is something we all do in our applications that get deployed on an application server, right? Using frameworks like Log4J or Logback\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-11-02T23:00:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Wim Van Haaren\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wim Van Haaren\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html\"},\"author\":{\"name\":\"Wim Van Haaren\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/6e0940e853ff40385bf3a29f2aea6f06\"},\"headline\":\"Server side logging from browser side JavaScript code\",\"datePublished\":\"2014-11-02T23:00:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html\"},\"wordCount\":415,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"keywords\":[\"JavaScript\",\"jQuery\",\"Spring\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html\",\"name\":\"Server side logging from browser side JavaScript code\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"datePublished\":\"2014-11-02T23:00:28+00:00\",\"description\":\"Application logging is something we all do in our applications that get deployed on an application server, right? Using frameworks like Log4J or Logback\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2014\\\/01\\\/javascript-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/11\\\/server-side-logging-from-browser-side-javascript-code.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Server side logging from browser side JavaScript code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/6e0940e853ff40385bf3a29f2aea6f06\",\"name\":\"Wim Van Haaren\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7fe2c83bdc989d7ec0ac87d8c8d52b3ed5f2f87db4e4880166e0eda3beec4bb4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7fe2c83bdc989d7ec0ac87d8c8d52b3ed5f2f87db4e4880166e0eda3beec4bb4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7fe2c83bdc989d7ec0ac87d8c8d52b3ed5f2f87db4e4880166e0eda3beec4bb4?s=96&d=mm&r=g\",\"caption\":\"Wim Van Haaren\"},\"sameAs\":[\"http:\\\/\\\/www.jdev.it\\\/blog\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/wim-van-haaren\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Server side logging from browser side JavaScript code","description":"Application logging is something we all do in our applications that get deployed on an application server, right? Using frameworks like Log4J or Logback","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html","og_locale":"en_US","og_type":"article","og_title":"Server side logging from browser side JavaScript code","og_description":"Application logging is something we all do in our applications that get deployed on an application server, right? Using frameworks like Log4J or Logback","og_url":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-11-02T23:00:28+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","type":"image\/jpeg"}],"author":"Wim Van Haaren","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Wim Van Haaren","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html"},"author":{"name":"Wim Van Haaren","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/6e0940e853ff40385bf3a29f2aea6f06"},"headline":"Server side logging from browser side JavaScript code","datePublished":"2014-11-02T23:00:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html"},"wordCount":415,"commentCount":2,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","keywords":["JavaScript","jQuery","Spring"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html","url":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html","name":"Server side logging from browser side JavaScript code","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","datePublished":"2014-11-02T23:00:28+00:00","description":"Application logging is something we all do in our applications that get deployed on an application server, right? Using frameworks like Log4J or Logback","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/01\/javascript-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2014\/11\/server-side-logging-from-browser-side-javascript-code.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Server side logging from browser side JavaScript code"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/6e0940e853ff40385bf3a29f2aea6f06","name":"Wim Van Haaren","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7fe2c83bdc989d7ec0ac87d8c8d52b3ed5f2f87db4e4880166e0eda3beec4bb4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7fe2c83bdc989d7ec0ac87d8c8d52b3ed5f2f87db4e4880166e0eda3beec4bb4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7fe2c83bdc989d7ec0ac87d8c8d52b3ed5f2f87db4e4880166e0eda3beec4bb4?s=96&d=mm&r=g","caption":"Wim Van Haaren"},"sameAs":["http:\/\/www.jdev.it\/blog\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/wim-van-haaren"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/32117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=32117"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/32117\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/20900"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=32117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=32117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=32117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}