juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [13/37] incubator-juneau-website git commit: Update javadocs
Date Mon, 27 Mar 2017 01:21:23 GMT
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/236aea45/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.NoOp.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.NoOp.html b/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.NoOp.html
index 5dc2002..a9cf015 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.NoOp.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.NoOp.html
@@ -156,89 +156,99 @@
 <span class="sourceLineNo">148</span>    * &lt;p&gt;<a name="line.148"></a>
 <span class="sourceLineNo">149</span>    * Subclasses can override this method to provide their own logic for determining when exceptions are logged.<a name="line.149"></a>
 <span class="sourceLineNo">150</span>    * &lt;p&gt;<a name="line.150"></a>
-<span class="sourceLineNo">151</span>    * The default implementation will return &lt;jk&gt;false&lt;/jk&gt; if &lt;js&gt;"noTrace=true"&lt;/js&gt; is passed in the query string.<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    *<a name="line.152"></a>
-<span class="sourceLineNo">153</span>    * @param req The HTTP request.<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    * @param res The HTTP response.<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    * @param e The exception.<a name="line.155"></a>
-<span class="sourceLineNo">156</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if exception should be logged.<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    */<a name="line.157"></a>
-<span class="sourceLineNo">158</span>   protected boolean shouldLog(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>      String q = req.getQueryString();<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      return (q == null ? true : q.indexOf("noTrace=true") == -1);<a name="line.160"></a>
-<span class="sourceLineNo">161</span>   }<a name="line.161"></a>
-<span class="sourceLineNo">162</span><a name="line.162"></a>
-<span class="sourceLineNo">163</span>   /**<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    * Returns &lt;jk&gt;true&lt;/jk&gt; if a stack trace should be logged for this exception.<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    * &lt;p&gt;<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    * Subclasses can override this method to provide their own logic for determining when stack traces are logged.<a name="line.166"></a>
+<span class="sourceLineNo">151</span>    * The default implementation will return &lt;jk&gt;false&lt;/jk&gt; if &lt;js&gt;"noTrace=true"&lt;/js&gt; is passed in the query string<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    *    or &lt;code&gt;No-Trace: true&lt;/code&gt; is specified in the header.<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    *<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    * @param req The HTTP request.<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    * @param res The HTTP response.<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    * @param e The exception.<a name="line.156"></a>
+<span class="sourceLineNo">157</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if exception should be logged.<a name="line.157"></a>
+<span class="sourceLineNo">158</span>    */<a name="line.158"></a>
+<span class="sourceLineNo">159</span>   protected boolean shouldLog(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>      if (isNoTrace(req) &amp;&amp; ! isDebug(req))<a name="line.160"></a>
+<span class="sourceLineNo">161</span>         return false;<a name="line.161"></a>
+<span class="sourceLineNo">162</span>      return true;<a name="line.162"></a>
+<span class="sourceLineNo">163</span>   }<a name="line.163"></a>
+<span class="sourceLineNo">164</span><a name="line.164"></a>
+<span class="sourceLineNo">165</span>   /**<a name="line.165"></a>
+<span class="sourceLineNo">166</span>    * Returns &lt;jk&gt;true&lt;/jk&gt; if a stack trace should be logged for this exception.<a name="line.166"></a>
 <span class="sourceLineNo">167</span>    * &lt;p&gt;<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    * The default implementation will only log a stack trace if {@link RestException#getOccurrence()} returns &lt;code&gt;1&lt;/code&gt;<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    *    and the exception is not one of the following:<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    * &lt;/p&gt;<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    * &lt;ul&gt;<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_UNAUTHORIZED}<a name="line.172"></a>
-<span class="sourceLineNo">173</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_FORBIDDEN}<a name="line.173"></a>
-<span class="sourceLineNo">174</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_NOT_FOUND}<a name="line.174"></a>
-<span class="sourceLineNo">175</span>    * &lt;/ul&gt;<a name="line.175"></a>
-<span class="sourceLineNo">176</span>    *<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    * @param req The HTTP request.<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    * @param res The HTTP response.<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    * @param e The exception.<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if stack trace should be logged.<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    */<a name="line.181"></a>
-<span class="sourceLineNo">182</span>   protected boolean shouldLogStackTrace(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      if (e.getOccurrence() == 1) {<a name="line.183"></a>
-<span class="sourceLineNo">184</span>         switch (e.getStatus()) {<a name="line.184"></a>
-<span class="sourceLineNo">185</span>            case SC_UNAUTHORIZED:<a name="line.185"></a>
-<span class="sourceLineNo">186</span>            case SC_FORBIDDEN:<a name="line.186"></a>
-<span class="sourceLineNo">187</span>            case SC_NOT_FOUND:  return false;<a name="line.187"></a>
-<span class="sourceLineNo">188</span>            default:            return true;<a name="line.188"></a>
-<span class="sourceLineNo">189</span>         }<a name="line.189"></a>
-<span class="sourceLineNo">190</span>      }<a name="line.190"></a>
-<span class="sourceLineNo">191</span>      return false;<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   }<a name="line.192"></a>
-<span class="sourceLineNo">193</span><a name="line.193"></a>
-<span class="sourceLineNo">194</span>   /**<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    * NO-OP logger.<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    * &lt;p&gt;<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    * Disables all logging.<a name="line.197"></a>
-<span class="sourceLineNo">198</span>    *<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    * @author James Bognar (james.bognar@salesforce.com)<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    */<a name="line.200"></a>
-<span class="sourceLineNo">201</span>   public static class NoOp extends RestLogger {<a name="line.201"></a>
-<span class="sourceLineNo">202</span><a name="line.202"></a>
-<span class="sourceLineNo">203</span>      @Override /* RestLogger */<a name="line.203"></a>
-<span class="sourceLineNo">204</span>      protected Logger getLogger() {<a name="line.204"></a>
-<span class="sourceLineNo">205</span>         return null;<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      }<a name="line.206"></a>
-<span class="sourceLineNo">207</span><a name="line.207"></a>
-<span class="sourceLineNo">208</span>      @Override /* RestLogger */<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {}<a name="line.209"></a>
-<span class="sourceLineNo">210</span>   }<a name="line.210"></a>
-<span class="sourceLineNo">211</span><a name="line.211"></a>
-<span class="sourceLineNo">212</span>   /**<a name="line.212"></a>
-<span class="sourceLineNo">213</span>    * Default logger.<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    * &lt;p&gt;<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    * Logs all messages to the logger returned by &lt;code&gt;Logger.&lt;jsm&gt;getLogger&lt;/jsm&gt;(getClass().getName())&lt;/code&gt;<a name="line.215"></a>
-<span class="sourceLineNo">216</span>    */<a name="line.216"></a>
-<span class="sourceLineNo">217</span>   public static class Normal extends RestLogger {<a name="line.217"></a>
-<span class="sourceLineNo">218</span><a name="line.218"></a>
-<span class="sourceLineNo">219</span>      private final JuneauLogger logger = JuneauLogger.getLogger(getClass());<a name="line.219"></a>
-<span class="sourceLineNo">220</span><a name="line.220"></a>
-<span class="sourceLineNo">221</span>      @Override /* RestLogger */<a name="line.221"></a>
-<span class="sourceLineNo">222</span>      protected Logger getLogger() {<a name="line.222"></a>
-<span class="sourceLineNo">223</span>         return logger;<a name="line.223"></a>
-<span class="sourceLineNo">224</span>      }<a name="line.224"></a>
-<span class="sourceLineNo">225</span><a name="line.225"></a>
-<span class="sourceLineNo">226</span>      @Override /* RestLogger */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {<a name="line.227"></a>
-<span class="sourceLineNo">228</span>         if (args.length &gt; 0)<a name="line.228"></a>
-<span class="sourceLineNo">229</span>            msg = MessageFormat.format(msg, args);<a name="line.229"></a>
-<span class="sourceLineNo">230</span>         getLogger().log(level, msg, cause);<a name="line.230"></a>
-<span class="sourceLineNo">231</span>      }<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   }<a name="line.232"></a>
-<span class="sourceLineNo">233</span>}<a name="line.233"></a>
+<span class="sourceLineNo">168</span>    * Subclasses can override this method to provide their own logic for determining when stack traces are logged.<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    * &lt;p&gt;<a name="line.169"></a>
+<span class="sourceLineNo">170</span>    * The default implementation will only log a stack trace if {@link RestException#getOccurrence()} returns &lt;code&gt;1&lt;/code&gt;<a name="line.170"></a>
+<span class="sourceLineNo">171</span>    *    and the exception is not one of the following:<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    * &lt;/p&gt;<a name="line.172"></a>
+<span class="sourceLineNo">173</span>    * &lt;ul&gt;<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_UNAUTHORIZED}<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_FORBIDDEN}<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_NOT_FOUND}<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    * &lt;/ul&gt;<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    *<a name="line.178"></a>
+<span class="sourceLineNo">179</span>    * @param req The HTTP request.<a name="line.179"></a>
+<span class="sourceLineNo">180</span>    * @param res The HTTP response.<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    * @param e The exception.<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if stack trace should be logged.<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    */<a name="line.183"></a>
+<span class="sourceLineNo">184</span>   protected boolean shouldLogStackTrace(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>      if (e.getOccurrence() == 1) {<a name="line.185"></a>
+<span class="sourceLineNo">186</span>         switch (e.getStatus()) {<a name="line.186"></a>
+<span class="sourceLineNo">187</span>            case SC_UNAUTHORIZED:<a name="line.187"></a>
+<span class="sourceLineNo">188</span>            case SC_FORBIDDEN:<a name="line.188"></a>
+<span class="sourceLineNo">189</span>            case SC_NOT_FOUND:  return false;<a name="line.189"></a>
+<span class="sourceLineNo">190</span>            default:            return true;<a name="line.190"></a>
+<span class="sourceLineNo">191</span>         }<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      }<a name="line.192"></a>
+<span class="sourceLineNo">193</span>      return false;<a name="line.193"></a>
+<span class="sourceLineNo">194</span>   }<a name="line.194"></a>
+<span class="sourceLineNo">195</span><a name="line.195"></a>
+<span class="sourceLineNo">196</span>   private static boolean isNoTrace(HttpServletRequest req) {<a name="line.196"></a>
+<span class="sourceLineNo">197</span>      return "true".equals(req.getHeader("No-Trace")) || req.getQueryString().contains("noTrace=true");<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   }<a name="line.198"></a>
+<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">200</span>   private static boolean isDebug(HttpServletRequest req) {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>      return "true".equals(req.getHeader("Debug"));<a name="line.201"></a>
+<span class="sourceLineNo">202</span>   }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>   /**<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    * NO-OP logger.<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    * &lt;p&gt;<a name="line.206"></a>
+<span class="sourceLineNo">207</span>    * Disables all logging.<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    *<a name="line.208"></a>
+<span class="sourceLineNo">209</span>    * @author James Bognar (james.bognar@salesforce.com)<a name="line.209"></a>
+<span class="sourceLineNo">210</span>    */<a name="line.210"></a>
+<span class="sourceLineNo">211</span>   public static class NoOp extends RestLogger {<a name="line.211"></a>
+<span class="sourceLineNo">212</span><a name="line.212"></a>
+<span class="sourceLineNo">213</span>      @Override /* RestLogger */<a name="line.213"></a>
+<span class="sourceLineNo">214</span>      protected Logger getLogger() {<a name="line.214"></a>
+<span class="sourceLineNo">215</span>         return null;<a name="line.215"></a>
+<span class="sourceLineNo">216</span>      }<a name="line.216"></a>
+<span class="sourceLineNo">217</span><a name="line.217"></a>
+<span class="sourceLineNo">218</span>      @Override /* RestLogger */<a name="line.218"></a>
+<span class="sourceLineNo">219</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {}<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   }<a name="line.220"></a>
+<span class="sourceLineNo">221</span><a name="line.221"></a>
+<span class="sourceLineNo">222</span>   /**<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    * Default logger.<a name="line.223"></a>
+<span class="sourceLineNo">224</span>    * &lt;p&gt;<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    * Logs all messages to the logger returned by &lt;code&gt;Logger.&lt;jsm&gt;getLogger&lt;/jsm&gt;(getClass().getName())&lt;/code&gt;<a name="line.225"></a>
+<span class="sourceLineNo">226</span>    */<a name="line.226"></a>
+<span class="sourceLineNo">227</span>   public static class Normal extends RestLogger {<a name="line.227"></a>
+<span class="sourceLineNo">228</span><a name="line.228"></a>
+<span class="sourceLineNo">229</span>      private final JuneauLogger logger = JuneauLogger.getLogger(getClass());<a name="line.229"></a>
+<span class="sourceLineNo">230</span><a name="line.230"></a>
+<span class="sourceLineNo">231</span>      @Override /* RestLogger */<a name="line.231"></a>
+<span class="sourceLineNo">232</span>      protected Logger getLogger() {<a name="line.232"></a>
+<span class="sourceLineNo">233</span>         return logger;<a name="line.233"></a>
+<span class="sourceLineNo">234</span>      }<a name="line.234"></a>
+<span class="sourceLineNo">235</span><a name="line.235"></a>
+<span class="sourceLineNo">236</span>      @Override /* RestLogger */<a name="line.236"></a>
+<span class="sourceLineNo">237</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {<a name="line.237"></a>
+<span class="sourceLineNo">238</span>         if (args.length &gt; 0)<a name="line.238"></a>
+<span class="sourceLineNo">239</span>            msg = MessageFormat.format(msg, args);<a name="line.239"></a>
+<span class="sourceLineNo">240</span>         getLogger().log(level, msg, cause);<a name="line.240"></a>
+<span class="sourceLineNo">241</span>      }<a name="line.241"></a>
+<span class="sourceLineNo">242</span>   }<a name="line.242"></a>
+<span class="sourceLineNo">243</span>}<a name="line.243"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/236aea45/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.Normal.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.Normal.html b/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.Normal.html
index 5dc2002..a9cf015 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.Normal.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.Normal.html
@@ -156,89 +156,99 @@
 <span class="sourceLineNo">148</span>    * &lt;p&gt;<a name="line.148"></a>
 <span class="sourceLineNo">149</span>    * Subclasses can override this method to provide their own logic for determining when exceptions are logged.<a name="line.149"></a>
 <span class="sourceLineNo">150</span>    * &lt;p&gt;<a name="line.150"></a>
-<span class="sourceLineNo">151</span>    * The default implementation will return &lt;jk&gt;false&lt;/jk&gt; if &lt;js&gt;"noTrace=true"&lt;/js&gt; is passed in the query string.<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    *<a name="line.152"></a>
-<span class="sourceLineNo">153</span>    * @param req The HTTP request.<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    * @param res The HTTP response.<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    * @param e The exception.<a name="line.155"></a>
-<span class="sourceLineNo">156</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if exception should be logged.<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    */<a name="line.157"></a>
-<span class="sourceLineNo">158</span>   protected boolean shouldLog(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>      String q = req.getQueryString();<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      return (q == null ? true : q.indexOf("noTrace=true") == -1);<a name="line.160"></a>
-<span class="sourceLineNo">161</span>   }<a name="line.161"></a>
-<span class="sourceLineNo">162</span><a name="line.162"></a>
-<span class="sourceLineNo">163</span>   /**<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    * Returns &lt;jk&gt;true&lt;/jk&gt; if a stack trace should be logged for this exception.<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    * &lt;p&gt;<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    * Subclasses can override this method to provide their own logic for determining when stack traces are logged.<a name="line.166"></a>
+<span class="sourceLineNo">151</span>    * The default implementation will return &lt;jk&gt;false&lt;/jk&gt; if &lt;js&gt;"noTrace=true"&lt;/js&gt; is passed in the query string<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    *    or &lt;code&gt;No-Trace: true&lt;/code&gt; is specified in the header.<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    *<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    * @param req The HTTP request.<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    * @param res The HTTP response.<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    * @param e The exception.<a name="line.156"></a>
+<span class="sourceLineNo">157</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if exception should be logged.<a name="line.157"></a>
+<span class="sourceLineNo">158</span>    */<a name="line.158"></a>
+<span class="sourceLineNo">159</span>   protected boolean shouldLog(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>      if (isNoTrace(req) &amp;&amp; ! isDebug(req))<a name="line.160"></a>
+<span class="sourceLineNo">161</span>         return false;<a name="line.161"></a>
+<span class="sourceLineNo">162</span>      return true;<a name="line.162"></a>
+<span class="sourceLineNo">163</span>   }<a name="line.163"></a>
+<span class="sourceLineNo">164</span><a name="line.164"></a>
+<span class="sourceLineNo">165</span>   /**<a name="line.165"></a>
+<span class="sourceLineNo">166</span>    * Returns &lt;jk&gt;true&lt;/jk&gt; if a stack trace should be logged for this exception.<a name="line.166"></a>
 <span class="sourceLineNo">167</span>    * &lt;p&gt;<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    * The default implementation will only log a stack trace if {@link RestException#getOccurrence()} returns &lt;code&gt;1&lt;/code&gt;<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    *    and the exception is not one of the following:<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    * &lt;/p&gt;<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    * &lt;ul&gt;<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_UNAUTHORIZED}<a name="line.172"></a>
-<span class="sourceLineNo">173</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_FORBIDDEN}<a name="line.173"></a>
-<span class="sourceLineNo">174</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_NOT_FOUND}<a name="line.174"></a>
-<span class="sourceLineNo">175</span>    * &lt;/ul&gt;<a name="line.175"></a>
-<span class="sourceLineNo">176</span>    *<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    * @param req The HTTP request.<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    * @param res The HTTP response.<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    * @param e The exception.<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if stack trace should be logged.<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    */<a name="line.181"></a>
-<span class="sourceLineNo">182</span>   protected boolean shouldLogStackTrace(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      if (e.getOccurrence() == 1) {<a name="line.183"></a>
-<span class="sourceLineNo">184</span>         switch (e.getStatus()) {<a name="line.184"></a>
-<span class="sourceLineNo">185</span>            case SC_UNAUTHORIZED:<a name="line.185"></a>
-<span class="sourceLineNo">186</span>            case SC_FORBIDDEN:<a name="line.186"></a>
-<span class="sourceLineNo">187</span>            case SC_NOT_FOUND:  return false;<a name="line.187"></a>
-<span class="sourceLineNo">188</span>            default:            return true;<a name="line.188"></a>
-<span class="sourceLineNo">189</span>         }<a name="line.189"></a>
-<span class="sourceLineNo">190</span>      }<a name="line.190"></a>
-<span class="sourceLineNo">191</span>      return false;<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   }<a name="line.192"></a>
-<span class="sourceLineNo">193</span><a name="line.193"></a>
-<span class="sourceLineNo">194</span>   /**<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    * NO-OP logger.<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    * &lt;p&gt;<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    * Disables all logging.<a name="line.197"></a>
-<span class="sourceLineNo">198</span>    *<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    * @author James Bognar (james.bognar@salesforce.com)<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    */<a name="line.200"></a>
-<span class="sourceLineNo">201</span>   public static class NoOp extends RestLogger {<a name="line.201"></a>
-<span class="sourceLineNo">202</span><a name="line.202"></a>
-<span class="sourceLineNo">203</span>      @Override /* RestLogger */<a name="line.203"></a>
-<span class="sourceLineNo">204</span>      protected Logger getLogger() {<a name="line.204"></a>
-<span class="sourceLineNo">205</span>         return null;<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      }<a name="line.206"></a>
-<span class="sourceLineNo">207</span><a name="line.207"></a>
-<span class="sourceLineNo">208</span>      @Override /* RestLogger */<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {}<a name="line.209"></a>
-<span class="sourceLineNo">210</span>   }<a name="line.210"></a>
-<span class="sourceLineNo">211</span><a name="line.211"></a>
-<span class="sourceLineNo">212</span>   /**<a name="line.212"></a>
-<span class="sourceLineNo">213</span>    * Default logger.<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    * &lt;p&gt;<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    * Logs all messages to the logger returned by &lt;code&gt;Logger.&lt;jsm&gt;getLogger&lt;/jsm&gt;(getClass().getName())&lt;/code&gt;<a name="line.215"></a>
-<span class="sourceLineNo">216</span>    */<a name="line.216"></a>
-<span class="sourceLineNo">217</span>   public static class Normal extends RestLogger {<a name="line.217"></a>
-<span class="sourceLineNo">218</span><a name="line.218"></a>
-<span class="sourceLineNo">219</span>      private final JuneauLogger logger = JuneauLogger.getLogger(getClass());<a name="line.219"></a>
-<span class="sourceLineNo">220</span><a name="line.220"></a>
-<span class="sourceLineNo">221</span>      @Override /* RestLogger */<a name="line.221"></a>
-<span class="sourceLineNo">222</span>      protected Logger getLogger() {<a name="line.222"></a>
-<span class="sourceLineNo">223</span>         return logger;<a name="line.223"></a>
-<span class="sourceLineNo">224</span>      }<a name="line.224"></a>
-<span class="sourceLineNo">225</span><a name="line.225"></a>
-<span class="sourceLineNo">226</span>      @Override /* RestLogger */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {<a name="line.227"></a>
-<span class="sourceLineNo">228</span>         if (args.length &gt; 0)<a name="line.228"></a>
-<span class="sourceLineNo">229</span>            msg = MessageFormat.format(msg, args);<a name="line.229"></a>
-<span class="sourceLineNo">230</span>         getLogger().log(level, msg, cause);<a name="line.230"></a>
-<span class="sourceLineNo">231</span>      }<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   }<a name="line.232"></a>
-<span class="sourceLineNo">233</span>}<a name="line.233"></a>
+<span class="sourceLineNo">168</span>    * Subclasses can override this method to provide their own logic for determining when stack traces are logged.<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    * &lt;p&gt;<a name="line.169"></a>
+<span class="sourceLineNo">170</span>    * The default implementation will only log a stack trace if {@link RestException#getOccurrence()} returns &lt;code&gt;1&lt;/code&gt;<a name="line.170"></a>
+<span class="sourceLineNo">171</span>    *    and the exception is not one of the following:<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    * &lt;/p&gt;<a name="line.172"></a>
+<span class="sourceLineNo">173</span>    * &lt;ul&gt;<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_UNAUTHORIZED}<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_FORBIDDEN}<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_NOT_FOUND}<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    * &lt;/ul&gt;<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    *<a name="line.178"></a>
+<span class="sourceLineNo">179</span>    * @param req The HTTP request.<a name="line.179"></a>
+<span class="sourceLineNo">180</span>    * @param res The HTTP response.<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    * @param e The exception.<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if stack trace should be logged.<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    */<a name="line.183"></a>
+<span class="sourceLineNo">184</span>   protected boolean shouldLogStackTrace(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>      if (e.getOccurrence() == 1) {<a name="line.185"></a>
+<span class="sourceLineNo">186</span>         switch (e.getStatus()) {<a name="line.186"></a>
+<span class="sourceLineNo">187</span>            case SC_UNAUTHORIZED:<a name="line.187"></a>
+<span class="sourceLineNo">188</span>            case SC_FORBIDDEN:<a name="line.188"></a>
+<span class="sourceLineNo">189</span>            case SC_NOT_FOUND:  return false;<a name="line.189"></a>
+<span class="sourceLineNo">190</span>            default:            return true;<a name="line.190"></a>
+<span class="sourceLineNo">191</span>         }<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      }<a name="line.192"></a>
+<span class="sourceLineNo">193</span>      return false;<a name="line.193"></a>
+<span class="sourceLineNo">194</span>   }<a name="line.194"></a>
+<span class="sourceLineNo">195</span><a name="line.195"></a>
+<span class="sourceLineNo">196</span>   private static boolean isNoTrace(HttpServletRequest req) {<a name="line.196"></a>
+<span class="sourceLineNo">197</span>      return "true".equals(req.getHeader("No-Trace")) || req.getQueryString().contains("noTrace=true");<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   }<a name="line.198"></a>
+<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">200</span>   private static boolean isDebug(HttpServletRequest req) {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>      return "true".equals(req.getHeader("Debug"));<a name="line.201"></a>
+<span class="sourceLineNo">202</span>   }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>   /**<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    * NO-OP logger.<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    * &lt;p&gt;<a name="line.206"></a>
+<span class="sourceLineNo">207</span>    * Disables all logging.<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    *<a name="line.208"></a>
+<span class="sourceLineNo">209</span>    * @author James Bognar (james.bognar@salesforce.com)<a name="line.209"></a>
+<span class="sourceLineNo">210</span>    */<a name="line.210"></a>
+<span class="sourceLineNo">211</span>   public static class NoOp extends RestLogger {<a name="line.211"></a>
+<span class="sourceLineNo">212</span><a name="line.212"></a>
+<span class="sourceLineNo">213</span>      @Override /* RestLogger */<a name="line.213"></a>
+<span class="sourceLineNo">214</span>      protected Logger getLogger() {<a name="line.214"></a>
+<span class="sourceLineNo">215</span>         return null;<a name="line.215"></a>
+<span class="sourceLineNo">216</span>      }<a name="line.216"></a>
+<span class="sourceLineNo">217</span><a name="line.217"></a>
+<span class="sourceLineNo">218</span>      @Override /* RestLogger */<a name="line.218"></a>
+<span class="sourceLineNo">219</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {}<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   }<a name="line.220"></a>
+<span class="sourceLineNo">221</span><a name="line.221"></a>
+<span class="sourceLineNo">222</span>   /**<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    * Default logger.<a name="line.223"></a>
+<span class="sourceLineNo">224</span>    * &lt;p&gt;<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    * Logs all messages to the logger returned by &lt;code&gt;Logger.&lt;jsm&gt;getLogger&lt;/jsm&gt;(getClass().getName())&lt;/code&gt;<a name="line.225"></a>
+<span class="sourceLineNo">226</span>    */<a name="line.226"></a>
+<span class="sourceLineNo">227</span>   public static class Normal extends RestLogger {<a name="line.227"></a>
+<span class="sourceLineNo">228</span><a name="line.228"></a>
+<span class="sourceLineNo">229</span>      private final JuneauLogger logger = JuneauLogger.getLogger(getClass());<a name="line.229"></a>
+<span class="sourceLineNo">230</span><a name="line.230"></a>
+<span class="sourceLineNo">231</span>      @Override /* RestLogger */<a name="line.231"></a>
+<span class="sourceLineNo">232</span>      protected Logger getLogger() {<a name="line.232"></a>
+<span class="sourceLineNo">233</span>         return logger;<a name="line.233"></a>
+<span class="sourceLineNo">234</span>      }<a name="line.234"></a>
+<span class="sourceLineNo">235</span><a name="line.235"></a>
+<span class="sourceLineNo">236</span>      @Override /* RestLogger */<a name="line.236"></a>
+<span class="sourceLineNo">237</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {<a name="line.237"></a>
+<span class="sourceLineNo">238</span>         if (args.length &gt; 0)<a name="line.238"></a>
+<span class="sourceLineNo">239</span>            msg = MessageFormat.format(msg, args);<a name="line.239"></a>
+<span class="sourceLineNo">240</span>         getLogger().log(level, msg, cause);<a name="line.240"></a>
+<span class="sourceLineNo">241</span>      }<a name="line.241"></a>
+<span class="sourceLineNo">242</span>   }<a name="line.242"></a>
+<span class="sourceLineNo">243</span>}<a name="line.243"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/236aea45/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.html b/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.html
index 5dc2002..a9cf015 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/rest/RestLogger.html
@@ -156,89 +156,99 @@
 <span class="sourceLineNo">148</span>    * &lt;p&gt;<a name="line.148"></a>
 <span class="sourceLineNo">149</span>    * Subclasses can override this method to provide their own logic for determining when exceptions are logged.<a name="line.149"></a>
 <span class="sourceLineNo">150</span>    * &lt;p&gt;<a name="line.150"></a>
-<span class="sourceLineNo">151</span>    * The default implementation will return &lt;jk&gt;false&lt;/jk&gt; if &lt;js&gt;"noTrace=true"&lt;/js&gt; is passed in the query string.<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    *<a name="line.152"></a>
-<span class="sourceLineNo">153</span>    * @param req The HTTP request.<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    * @param res The HTTP response.<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    * @param e The exception.<a name="line.155"></a>
-<span class="sourceLineNo">156</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if exception should be logged.<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    */<a name="line.157"></a>
-<span class="sourceLineNo">158</span>   protected boolean shouldLog(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>      String q = req.getQueryString();<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      return (q == null ? true : q.indexOf("noTrace=true") == -1);<a name="line.160"></a>
-<span class="sourceLineNo">161</span>   }<a name="line.161"></a>
-<span class="sourceLineNo">162</span><a name="line.162"></a>
-<span class="sourceLineNo">163</span>   /**<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    * Returns &lt;jk&gt;true&lt;/jk&gt; if a stack trace should be logged for this exception.<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    * &lt;p&gt;<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    * Subclasses can override this method to provide their own logic for determining when stack traces are logged.<a name="line.166"></a>
+<span class="sourceLineNo">151</span>    * The default implementation will return &lt;jk&gt;false&lt;/jk&gt; if &lt;js&gt;"noTrace=true"&lt;/js&gt; is passed in the query string<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    *    or &lt;code&gt;No-Trace: true&lt;/code&gt; is specified in the header.<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    *<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    * @param req The HTTP request.<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    * @param res The HTTP response.<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    * @param e The exception.<a name="line.156"></a>
+<span class="sourceLineNo">157</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if exception should be logged.<a name="line.157"></a>
+<span class="sourceLineNo">158</span>    */<a name="line.158"></a>
+<span class="sourceLineNo">159</span>   protected boolean shouldLog(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>      if (isNoTrace(req) &amp;&amp; ! isDebug(req))<a name="line.160"></a>
+<span class="sourceLineNo">161</span>         return false;<a name="line.161"></a>
+<span class="sourceLineNo">162</span>      return true;<a name="line.162"></a>
+<span class="sourceLineNo">163</span>   }<a name="line.163"></a>
+<span class="sourceLineNo">164</span><a name="line.164"></a>
+<span class="sourceLineNo">165</span>   /**<a name="line.165"></a>
+<span class="sourceLineNo">166</span>    * Returns &lt;jk&gt;true&lt;/jk&gt; if a stack trace should be logged for this exception.<a name="line.166"></a>
 <span class="sourceLineNo">167</span>    * &lt;p&gt;<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    * The default implementation will only log a stack trace if {@link RestException#getOccurrence()} returns &lt;code&gt;1&lt;/code&gt;<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    *    and the exception is not one of the following:<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    * &lt;/p&gt;<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    * &lt;ul&gt;<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_UNAUTHORIZED}<a name="line.172"></a>
-<span class="sourceLineNo">173</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_FORBIDDEN}<a name="line.173"></a>
-<span class="sourceLineNo">174</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_NOT_FOUND}<a name="line.174"></a>
-<span class="sourceLineNo">175</span>    * &lt;/ul&gt;<a name="line.175"></a>
-<span class="sourceLineNo">176</span>    *<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    * @param req The HTTP request.<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    * @param res The HTTP response.<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    * @param e The exception.<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if stack trace should be logged.<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    */<a name="line.181"></a>
-<span class="sourceLineNo">182</span>   protected boolean shouldLogStackTrace(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      if (e.getOccurrence() == 1) {<a name="line.183"></a>
-<span class="sourceLineNo">184</span>         switch (e.getStatus()) {<a name="line.184"></a>
-<span class="sourceLineNo">185</span>            case SC_UNAUTHORIZED:<a name="line.185"></a>
-<span class="sourceLineNo">186</span>            case SC_FORBIDDEN:<a name="line.186"></a>
-<span class="sourceLineNo">187</span>            case SC_NOT_FOUND:  return false;<a name="line.187"></a>
-<span class="sourceLineNo">188</span>            default:            return true;<a name="line.188"></a>
-<span class="sourceLineNo">189</span>         }<a name="line.189"></a>
-<span class="sourceLineNo">190</span>      }<a name="line.190"></a>
-<span class="sourceLineNo">191</span>      return false;<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   }<a name="line.192"></a>
-<span class="sourceLineNo">193</span><a name="line.193"></a>
-<span class="sourceLineNo">194</span>   /**<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    * NO-OP logger.<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    * &lt;p&gt;<a name="line.196"></a>
-<span class="sourceLineNo">197</span>    * Disables all logging.<a name="line.197"></a>
-<span class="sourceLineNo">198</span>    *<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    * @author James Bognar (james.bognar@salesforce.com)<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    */<a name="line.200"></a>
-<span class="sourceLineNo">201</span>   public static class NoOp extends RestLogger {<a name="line.201"></a>
-<span class="sourceLineNo">202</span><a name="line.202"></a>
-<span class="sourceLineNo">203</span>      @Override /* RestLogger */<a name="line.203"></a>
-<span class="sourceLineNo">204</span>      protected Logger getLogger() {<a name="line.204"></a>
-<span class="sourceLineNo">205</span>         return null;<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      }<a name="line.206"></a>
-<span class="sourceLineNo">207</span><a name="line.207"></a>
-<span class="sourceLineNo">208</span>      @Override /* RestLogger */<a name="line.208"></a>
-<span class="sourceLineNo">209</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {}<a name="line.209"></a>
-<span class="sourceLineNo">210</span>   }<a name="line.210"></a>
-<span class="sourceLineNo">211</span><a name="line.211"></a>
-<span class="sourceLineNo">212</span>   /**<a name="line.212"></a>
-<span class="sourceLineNo">213</span>    * Default logger.<a name="line.213"></a>
-<span class="sourceLineNo">214</span>    * &lt;p&gt;<a name="line.214"></a>
-<span class="sourceLineNo">215</span>    * Logs all messages to the logger returned by &lt;code&gt;Logger.&lt;jsm&gt;getLogger&lt;/jsm&gt;(getClass().getName())&lt;/code&gt;<a name="line.215"></a>
-<span class="sourceLineNo">216</span>    */<a name="line.216"></a>
-<span class="sourceLineNo">217</span>   public static class Normal extends RestLogger {<a name="line.217"></a>
-<span class="sourceLineNo">218</span><a name="line.218"></a>
-<span class="sourceLineNo">219</span>      private final JuneauLogger logger = JuneauLogger.getLogger(getClass());<a name="line.219"></a>
-<span class="sourceLineNo">220</span><a name="line.220"></a>
-<span class="sourceLineNo">221</span>      @Override /* RestLogger */<a name="line.221"></a>
-<span class="sourceLineNo">222</span>      protected Logger getLogger() {<a name="line.222"></a>
-<span class="sourceLineNo">223</span>         return logger;<a name="line.223"></a>
-<span class="sourceLineNo">224</span>      }<a name="line.224"></a>
-<span class="sourceLineNo">225</span><a name="line.225"></a>
-<span class="sourceLineNo">226</span>      @Override /* RestLogger */<a name="line.226"></a>
-<span class="sourceLineNo">227</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {<a name="line.227"></a>
-<span class="sourceLineNo">228</span>         if (args.length &gt; 0)<a name="line.228"></a>
-<span class="sourceLineNo">229</span>            msg = MessageFormat.format(msg, args);<a name="line.229"></a>
-<span class="sourceLineNo">230</span>         getLogger().log(level, msg, cause);<a name="line.230"></a>
-<span class="sourceLineNo">231</span>      }<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   }<a name="line.232"></a>
-<span class="sourceLineNo">233</span>}<a name="line.233"></a>
+<span class="sourceLineNo">168</span>    * Subclasses can override this method to provide their own logic for determining when stack traces are logged.<a name="line.168"></a>
+<span class="sourceLineNo">169</span>    * &lt;p&gt;<a name="line.169"></a>
+<span class="sourceLineNo">170</span>    * The default implementation will only log a stack trace if {@link RestException#getOccurrence()} returns &lt;code&gt;1&lt;/code&gt;<a name="line.170"></a>
+<span class="sourceLineNo">171</span>    *    and the exception is not one of the following:<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    * &lt;/p&gt;<a name="line.172"></a>
+<span class="sourceLineNo">173</span>    * &lt;ul&gt;<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_UNAUTHORIZED}<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_FORBIDDEN}<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    *    &lt;li&gt;{@link HttpServletResponse#SC_NOT_FOUND}<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    * &lt;/ul&gt;<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    *<a name="line.178"></a>
+<span class="sourceLineNo">179</span>    * @param req The HTTP request.<a name="line.179"></a>
+<span class="sourceLineNo">180</span>    * @param res The HTTP response.<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    * @param e The exception.<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    * @return &lt;jk&gt;true&lt;/jk&gt; if stack trace should be logged.<a name="line.182"></a>
+<span class="sourceLineNo">183</span>    */<a name="line.183"></a>
+<span class="sourceLineNo">184</span>   protected boolean shouldLogStackTrace(HttpServletRequest req, HttpServletResponse res, RestException e) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>      if (e.getOccurrence() == 1) {<a name="line.185"></a>
+<span class="sourceLineNo">186</span>         switch (e.getStatus()) {<a name="line.186"></a>
+<span class="sourceLineNo">187</span>            case SC_UNAUTHORIZED:<a name="line.187"></a>
+<span class="sourceLineNo">188</span>            case SC_FORBIDDEN:<a name="line.188"></a>
+<span class="sourceLineNo">189</span>            case SC_NOT_FOUND:  return false;<a name="line.189"></a>
+<span class="sourceLineNo">190</span>            default:            return true;<a name="line.190"></a>
+<span class="sourceLineNo">191</span>         }<a name="line.191"></a>
+<span class="sourceLineNo">192</span>      }<a name="line.192"></a>
+<span class="sourceLineNo">193</span>      return false;<a name="line.193"></a>
+<span class="sourceLineNo">194</span>   }<a name="line.194"></a>
+<span class="sourceLineNo">195</span><a name="line.195"></a>
+<span class="sourceLineNo">196</span>   private static boolean isNoTrace(HttpServletRequest req) {<a name="line.196"></a>
+<span class="sourceLineNo">197</span>      return "true".equals(req.getHeader("No-Trace")) || req.getQueryString().contains("noTrace=true");<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   }<a name="line.198"></a>
+<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">200</span>   private static boolean isDebug(HttpServletRequest req) {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>      return "true".equals(req.getHeader("Debug"));<a name="line.201"></a>
+<span class="sourceLineNo">202</span>   }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>   /**<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    * NO-OP logger.<a name="line.205"></a>
+<span class="sourceLineNo">206</span>    * &lt;p&gt;<a name="line.206"></a>
+<span class="sourceLineNo">207</span>    * Disables all logging.<a name="line.207"></a>
+<span class="sourceLineNo">208</span>    *<a name="line.208"></a>
+<span class="sourceLineNo">209</span>    * @author James Bognar (james.bognar@salesforce.com)<a name="line.209"></a>
+<span class="sourceLineNo">210</span>    */<a name="line.210"></a>
+<span class="sourceLineNo">211</span>   public static class NoOp extends RestLogger {<a name="line.211"></a>
+<span class="sourceLineNo">212</span><a name="line.212"></a>
+<span class="sourceLineNo">213</span>      @Override /* RestLogger */<a name="line.213"></a>
+<span class="sourceLineNo">214</span>      protected Logger getLogger() {<a name="line.214"></a>
+<span class="sourceLineNo">215</span>         return null;<a name="line.215"></a>
+<span class="sourceLineNo">216</span>      }<a name="line.216"></a>
+<span class="sourceLineNo">217</span><a name="line.217"></a>
+<span class="sourceLineNo">218</span>      @Override /* RestLogger */<a name="line.218"></a>
+<span class="sourceLineNo">219</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {}<a name="line.219"></a>
+<span class="sourceLineNo">220</span>   }<a name="line.220"></a>
+<span class="sourceLineNo">221</span><a name="line.221"></a>
+<span class="sourceLineNo">222</span>   /**<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    * Default logger.<a name="line.223"></a>
+<span class="sourceLineNo">224</span>    * &lt;p&gt;<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    * Logs all messages to the logger returned by &lt;code&gt;Logger.&lt;jsm&gt;getLogger&lt;/jsm&gt;(getClass().getName())&lt;/code&gt;<a name="line.225"></a>
+<span class="sourceLineNo">226</span>    */<a name="line.226"></a>
+<span class="sourceLineNo">227</span>   public static class Normal extends RestLogger {<a name="line.227"></a>
+<span class="sourceLineNo">228</span><a name="line.228"></a>
+<span class="sourceLineNo">229</span>      private final JuneauLogger logger = JuneauLogger.getLogger(getClass());<a name="line.229"></a>
+<span class="sourceLineNo">230</span><a name="line.230"></a>
+<span class="sourceLineNo">231</span>      @Override /* RestLogger */<a name="line.231"></a>
+<span class="sourceLineNo">232</span>      protected Logger getLogger() {<a name="line.232"></a>
+<span class="sourceLineNo">233</span>         return logger;<a name="line.233"></a>
+<span class="sourceLineNo">234</span>      }<a name="line.234"></a>
+<span class="sourceLineNo">235</span><a name="line.235"></a>
+<span class="sourceLineNo">236</span>      @Override /* RestLogger */<a name="line.236"></a>
+<span class="sourceLineNo">237</span>      protected void log(Level level, Throwable cause, String msg, Object...args) {<a name="line.237"></a>
+<span class="sourceLineNo">238</span>         if (args.length &gt; 0)<a name="line.238"></a>
+<span class="sourceLineNo">239</span>            msg = MessageFormat.format(msg, args);<a name="line.239"></a>
+<span class="sourceLineNo">240</span>         getLogger().log(level, msg, cause);<a name="line.240"></a>
+<span class="sourceLineNo">241</span>      }<a name="line.241"></a>
+<span class="sourceLineNo">242</span>   }<a name="line.242"></a>
+<span class="sourceLineNo">243</span>}<a name="line.243"></a>
 
 
 


Mime
View raw message