/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.example.managedvms.gettingstartedjava.basicactions;

import com.example.managedvms.gettingstartedjava.daos.BookDao;
import com.example.managedvms.gettingstartedjava.objects.Book;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

// [START example]
@SuppressWarnings("serial")
@WebServlet(name = "read", value = "/read")
public class ReadBookServlet extends HttpServlet {

  private final Logger logger =
      Logger.getLogger(
         com.example.managedvms.gettingstartedjava.basicactions.ReadBookServlet.class.getName());

  @Override
  public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException,
      ServletException {
    Long id = Long.decode(req.getParameter("id"));
    BookDao dao = (BookDao) this.getServletContext().getAttribute("dao");
    try {
      Book book = dao.readBook(id);
      logger.log(Level.INFO, "Read book with id {0}", id);
      req.setAttribute("book", book);
      req.setAttribute("page", "view");
      req.getRequestDispatcher("/base.jsp").forward(req, resp);
    } catch (Exception e) {
      throw new ServletException("Error reading book", e);
    }
  }
}
// [END example]

@@ -809,102 +809,8 @@
 k;%0A%0A
-import java.io.IOException;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;%0A%0A
 impo
@@ -844,16 +844,16 @@
 eption;%0A
+
 import j
@@ -1019,16 +1019,109 @@
 esponse;
+%0Aimport java.io.IOException;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;
 %0A%0A// %5BST
@@ -1256,16 +1256,31 @@
 rvlet %7B%0A
+// %5BSTART init%5D
 %0A  priva
@@ -1303,22 +1303,16 @@
 logger =
-%0A     
  Logger.
@@ -1325,73 +1325,8 @@
 ger(
-%0A         com.example.managedvms.gettingstartedjava.basicactions.
 Read
@@ -1355,16 +1355,32 @@
 ame());%0A
+// %5BEND init%5D%0A  
 %0A  @Over
@@ -1666,24 +1666,45 @@
 adBook(id);%0A
+      // %5BSTART log%5D%0A
       logger
@@ -1746,24 +1746,43 @@
  %7B0%7D%22, id);%0A
+      // %5BEND log%5D%0A
       req.se

Add annotation for logger