Skip to Content

SMP 3 Management Cockpit Extension – Log Viewer

Introduction

If you are using SAP Mobile Platform 3 you are likely also using the Management Cockpit which provides you functionality by a browser-based admin UI. Unfortunately, one very important component is not graphically visualized: the SERVER LOG

Especially, when debugging problems or developing client/server applications I am looking quite frequently into the server log file. If you cannot open the file itself on the file system (maybe because you do not have file access to the server’s log folder), you always have to download the server log as a “.log” file and then open it in a text editor. This process is highly inefficient, because you have to perform the same steps every time you want to see new information in the log…

Alina Pollklaesener was working in our team on a solution for this “problem”. She developed a SMP Management Cockpit Extension which can be used to visualize the server log. When initially called the SAPUI5 web app is parsing the existing server log and visualizing it in a searchable and filterable table structure. Additionally a “Live Monitoring” can be enabled which establish a Web Socket connection to the SMP server, so that new log entries will be displayed almost in real time inside the web app (without the need to manually refresh the webpage).


/wp-content/uploads/2016/07/overview_995997.png /wp-content/uploads/2016/07/server_log_995998.png


The installation (or deployment) of the extension is pretty easy. Simply drop the two packages into SMP’s pickup folder and then access the logViewer inside your browser by url http://smpServer:port/logViewer . The bundles can be found on github, here https://github.com/MarvinHoffmann/smp3-logviewer


Information


Please be aware that this extension is not an official SAP product. If you are using it, you will use it on your own risk. SAP does not provide official support for this.


This logViewer is intended for development and sandbox environments. Please do not use this web app in production environments! The log viewer is not password protected and running without access protection on port 8080 or 8081. The live log monitoring is currently only possible on http port 8080.

In the following Alina described and introduced the logViewer in more detail:


SMP Management Cockpit Extension


The SMP Management Cockpit Extension at hand is purposed to visualize existing SMP server log information within a SAP UI5 Web Application. Moreover, upcoming log messages are added to the user interface in real-time. Several filter and search options are provided. Thus, an efficient error and log message analysis is facilitated.

Deployment

The functionality is provided by two OSGi-Bundles: logProviderWab-1.0.jar provides access to the log data in the backend, logViewer.war contains the resources of the web app.

Download both bundles from github: https://github.com/MarvinHoffmann/smp3-logviewer

To deploy the Management Cockpit extension on your SAP Mobile Platform, the files simply have to be deposited within a specific folder on the SMP Server. The according path is …\SAP\MobilePlatform3\Server\pickup. If the deployment was successful, the .state-Folder on the same path contains corresponding OK Files.

/wp-content/uploads/2016/07/deployment_996005.png

Access

The extension launchpad can be accessed via host:port/logViewer, the SMP server log visualization via host:port/logViewer/#/serverLog. Please replace host and port with the values that are valid for your SMP, e.g. http://dewdfwssc5070.emea.global.corp.sap:8080/logViewer. The live monitoring feature is currently only available via http (port 8080).

Functionality and Usage

The user interface lists the diverse log messages within a grid table. Furthermore, several filter and search options are provided to facilitate their analysis.

logViewer_functionality.png

In this context, the Icon Tab Bar can be used to display only messages of a specific log level.  Furthermore, it delivers information about the number of  messages within the different categories.

Within the Filter Bar filter options for the diverse table columns can be specified. Initially, only a couple of input fields are displayed. A click on the button Filters opens up a dialog window enabling the user to add or remove additional fields to/from the Filter Bar. To filter the table according to an entered start and/or end time, a date range must be specified.

/wp-content/uploads/2016/07/filter_995983.png

For the purpose of efficiency, the created variants can be saved for subsequent reuse. The Basic Search Field can be used to search all table columns for the entered term.

The visibility of the diverse columns can be configured via click on the table’s header. Equally, the width of the separate columns as well as the height of the whole table can be adjusted to the user’s requirements – by using a grip with the mouse.

/wp-content/uploads/2016/07/columns_995982.png

To optimize the app’s performance, log messages are not constantly added in real-time. The user interface contains a button to start and pause this so called Live Monitoring functionality.

/wp-content/uploads/2016/07/live_monitoring_995981.png

The maximum number of columns and lines within the table is limited. This limitation frequently leads to an incomplete display of certain log information. Especially often, the detailed log message texts are affected. Thus, a click on a specific table row opens up a popup window which displays the correspondent message entirely. In this context, the portrayed log message can also be downloaded as a .txt-file.

/wp-content/uploads/2016/07/log_details_995968.png

——————-

Conclusion

This extension is quite handy if you are frequently using SMP’s server log, especially the “live monitoring” simplifies debugging and trouble shooting on the platform. Additionally, this custom log viewer shows the flexibility of the SAP Mobile Platform in general. If you want to have more features or a production ready release (including security enhancements) ask for SAP Consulting (SAP Mobile Innovation Technology / SAP Mobile UX DE).

SAPMIT_Logo.png

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Johan Stie

    Very nice !!!

    A quick and easy overview of the log.

    An extra would be a central log for a clustered environment. For now we need to log on to the separate systems and look into the logs.

    But .. nice work !!

    (0) 
      1. Marvin Hoffmann Post author

        I agree with you both. A cumulative log view for clustered environments would be great.

        But as mentioned this tool is (in the current state) more targeting on development and sandbox systems. These environments are usually anyway not clustered…

        (0) 
  2. Thomas Göbel

    Hello,

    after deploying the logviewer our SMP did not come up.

    The following error could be found in the server-log:
    2016 11 14 09:14:44#+0100#ERROR#org.osgi.service.log.LogService###org.eclipse.virgo.medic.log.osgi.OSGiLogServiceListener@4cd6efa7#########Bundle org.eclipse.osgi_3.8.1.v20120830-144521, SMPServerStatusManager: 2016 11 14 09:14:44.750 Bundles (and their services) not yet initialized: logProviderWab <– Issue

    After copying back the bundles.info-file ( the version before the deploying of the log viewer )
    in /usr/sap/MobilePlatform3/Server/configuration/org.eclipse.equinox.simpleconfigurator SMP is starting again.

    Does the logviewer not work with SMP-Version 3.0.11.2?

    Regards
    Thomas

    (0) 
  3. Janek Bakiewicz

    Hello,

     

    I had the same observation Thomas had, just wih SMP version 3.0.12.3

    After deploying logviewer, SMP could not be restarted anymore. SMP did work for a couple of weeks, but a restart failed,.

    Just undeploying the logviewer.war and the logProviderWab-1.0 jar solved the restart issue.

    Is there an improved version of these packages?

    Kind regards,

    Janek

    (0) 

Leave a Reply