Document Tree
Document Properties
Kbid
308V18
Last Modified
25-Apr-2023
Added to KB
18-Apr-2023
Public Access
Everyone
Status
Online
Doc Type
Concepts
Product
Intershop Progressive Web App
Concept - Intershop Progressive Web App - Logging

Server-Side Rendering (SSR)

The express.js image serving the Angular Universal Server-Side Rendering can be provisioned to log extended information to the console by supplying the environment variable LOGGING=true.

Information logged to the console includes the following:

  • Requests to the SSR process are logged with morgan (see configuration in server.ts) in the form of:

    <method> <url> <status> <bytes> - <duration> ms

  • Requests handled by the SSR process are logged at the beginning with SSR <url> and at the end with RES <status> <url>.

  • Further the redirect actions of the Hybrid Approach are logged with RED <url>.

  • Uncaught Error objects thrown in the SSR process, including HttpErrorResponse and runtime errors, are printed as well.

NGINX

The NGINX image providing multi-channel configuration uses the default logging capabilities of nginx.
You can enable json formatted logging by passing the environment variable LOGFORMAT=json to the container.
If no LOGFORMAT variable is passed, the container uses main as its default format.

Additionally, the environment variable DEBUG=true provides even more debugging output in the NGINX logs.

Logging to an External Device

Within PWA development systems, information from the SSR and NGINX containers can be stored in external log files for analysis purposes.
When launching your PWA as a Docker image/container, you can copy the log information from the containers which can be stored in the local file system using Docker volumes.
Enabled volumes allow you to write SSR and NGINX logs in local Unix/Windows directories.

The path is composed as follows:

  • d:/pwa/logs - The local Windows/Unix directory of the development machine where the logs should be stored.
  • /var/log/ - The log location in the SSR/NGINX container.

To enable logging to volumes, copy the examples below to the according docker-compose.yml sections.

PWA (SSR with PM2)

volumes:
  - d:/pwa/logs:/.pm2/logs/

NGINX

volumes:
  - d:/pwa/logs:/var/log/

Further References

Disclaimer
The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.
The Intershop Knowledge Portal uses only technically necessary cookies. We do not track visitors or have visitors tracked by 3rd parties. Please find further information on privacy in the Intershop Privacy Policy and Legal Notice.
Home
Knowledge Base
Product Releases
Log on to continue
This Knowledge Base document is reserved for registered customers.
Log on with your Intershop Entra ID to continue.
Write an email to supportadmin@intershop.de if you experience login issues,
or if you want to register as customer.