Skip to Content

Get Started with SAP Application Logging Service in the Neo Environment

Requires Customer/Partner License
Configure logs and view them in the SAP BTP cockpit.
You will learn
  • How to configure log messages and loggers
nikolasimeonov77Nikola SimeonovNovember 11, 2021
Created by
November 11, 2021


  • Step 1

    See Install the SAP BTP SDK for Neo Environment.
    For example, for Java Web Tomcat 8, download neo-java-web-sdk-<version>.zip.

  • Step 2

    Open the src\com\sap\cloud\sample\helloworld\ file in the hello-world sample and update the file with the following code:


    package; import; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Servlet implementing simplest possible hello world application for SAP BTP Neo Environment. */ public class HelloWorldServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static final Logger LOGGER = LoggerFactory.getLogger(HelloWorldServlet.class); /** {@inheritDoc} */ @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {"Hello World!"); response.getWriter().println("<p>Hello World!</p>"); } }

    Now you can view information about configured loggers when requesting the helloworld application. This information is also logged in the default trace logs with the text Hello World! when you set a log with level INFO.

  • Step 3
  • Step 4
  • Step 5

    Specify the JAVA HOME variable to the jre folder of the installed SAP JVM and the Path variable to the bin folder of the installed Apache Maven.

  • Step 6

    Go to the <installed SDK>/samples/hello-world folder in the command prompt and run the command mvn clean install to compile, test, and package the hello-world project.

    You can now find your packaged WAR file in the target folder.

    In the text area below, enter the command you used to compile, test, and package the hello-world project.

  • Step 7

    On the Java Applications page, deploy the WAR file and start the helloworld application. See Deploy on the Cloud with the Cockpit.

    Deploy Application
  • Step 8

    Choose the helloworld application link to open the application’s Overview page and request the application by opening the application URL.

    The application now displays the Hello World! message.

    This operation guarantees that the logger is available.

  • Step 9
    1. Go to the Logging page.

    2. Set the log level.

      Set the INFO log level of the logger that you added to See the Configure Loggers section in Using Logs in the Cockpit for Java Applications.
      Furthermore, you can find information about the various log levels at Implementing Logging for Java Applications.

      Set INFO log level

    In the text area below, enter the logger that you set the log level for.

  • Step 10

    Go to the Overview page and choose the application URL.

    The application now displays the Hello World! message.

  • Step 11
    1. Go back to the Logging page, display the HTTP access log in a log viewer and search for the path hello-world to see the helloworld application logs. For more information, see Log Viewers for Java Applications.

      HTTP access logs

    2. From the Logging page, display the default trace in a log viewer and search for text Hello World! to find the logs from the request operation.

      Default trace logs

Back to top