]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Added logger to tag + used "this"
authorRoland Haeder <roland@mxchange.org>
Thu, 27 Aug 2015 19:17:48 +0000 (21:17 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 27 Aug 2015 19:17:48 +0000 (21:17 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/pizzaapplication/beans/PizzaServiceBean.java
src/java/org/mxchange/pizzaapplication/tags/basket/MiniBasketTag.java

index 7ff4e8bab7099582d62da8713b32f0cbd3e40d16..fbbb338f96d49aa6a1ced7b45954ff105a76af50 100644 (file)
@@ -81,8 +81,8 @@ public class PizzaServiceBean implements PizzaBean {
         */
        {
                // Get new application instance
-               LOG = LogManager.getLogger(this);
-               LOG.debug("INITIALIZER!");
+               this.LOG = LogManager.getLogger(this);
+               this.LOG.debug("INITIALIZER!");
                this.app = new PizzaServiceApplication();
        }
 
index 1ec420a3766f0aef2b1b0b9b4a741692c6eb220c..b0d84b9e5d8c6c660fc50637790725dee4542c61 100644 (file)
@@ -21,6 +21,8 @@ import java.lang.reflect.InvocationTargetException;
 import java.sql.SQLException;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.BodyTagSupport;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.mxchange.jcore.exceptions.BadTokenException;
 import org.mxchange.jcore.exceptions.CorruptedDatabaseFileException;
 import org.mxchange.pizzaapplication.beans.basket.BasketBean;
@@ -41,6 +43,18 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag {
         */
        private BasketBean basket;
 
+       /**
+        * Logger instance
+        */
+       private final Logger LOG;
+
+       /**
+        * Initializer
+        */
+       {
+               this.LOG = LogManager.getLogger(this);
+       }
+
        /**
         * Outputs a div container with last added item + a link to the basket
         * web page.
@@ -50,6 +64,9 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag {
         */
        @Override
        public int doStartTag () throws JspException {
+               // Trace message
+               this.LOG.trace("CALLED!");
+
                // Init output
                StringBuilder out = new StringBuilder("<div class=\"mini_basket\">\n");
 
@@ -86,6 +103,9 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag {
                        throw new JspException(ex);
                }
 
+               // Trace message
+               this.LOG.trace("Returning " + SKIP_BODY + " ... - EXIT!");
+
                // Don't process any body
                return SKIP_BODY;
        }
@@ -95,6 +115,10 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag {
         */
        @Override
        public BasketBean getBasket () {
+               // Trace message
+               this.LOG.trace("basket=" + this.basket + " - EXIT!");
+
+               // Return it
                return this.basket;
        }
 
@@ -103,6 +127,10 @@ public class MiniBasketTag extends BodyTagSupport implements BasketTag {
         */
        @Override
        public void setBasket (final BasketBean basket) {
+               // Trace message
+               this.LOG.trace("basked=" + basket + " - CALLED!");
+
+               // Set it here
                this.basket = basket;
        }
 }