Dynamically Set `cds.log` Levels and Formats
maincds.log system. It allows for runtime adjustments to logging behavior without requiring a service restart.repository·main·Indexed 20 days ago
https://github.com/sap-archive/cloud-cap-samplesA monorepo (@capire/samples v3.0.0) containing several demonstration projects for the SAP Cloud Application Programming Model (CAP). It includes the Bookshop Getting Started sample for domain modeling and custom logic, a dynamic logging sample for cds.log, and the Reviews Service for modular microservices patterns. Additional packages include @capire/common for library extensions, @capire/orders for compositions, and @capire/bookstore, a composite application integrating Vue.js and SAP Fiori elements.
cds.log system. It allows for runtime adjustments to logging behavior without requiring a service restart.The @capire/common package demonstrates how to extend the standard @sap/cds/common library. It is a useful reference for:
To run the entire Reviews Service Sample (including the Fiori application) as a single integrated process, use the fiori script. This is the simplest way to get the sample up and running for testing.
npm run fioriIf you need to run the backend reviews service and the frontend Fiori application independently, follow these steps using two separate terminal windows:
This approach is useful for debugging the service independently of the UI or simulating a distributed environment.
# Terminal 1: Start the reviews service
npm run reviews-service
# Terminal 2: Start the fiori app
npm run fioriTo start the Bookshop sample in development mode with file watching enabled, use the following npm command. This will run the CAP services and allow you to interact with them (typically at http://localhost:4004).
npm run watchThe Bookshop sample demonstrates various CAP (Cloud Application Programming Model) development tasks. You can map the following sample files and folders to their corresponding CAP concepts:
./../db/schema.cds using CDS../srv/*.cds (includes single-purposed services)../srv/*.js../db/data/*.csv../index.cds../test directory.The @capire/reviews package showcases how to build a modular service for managing product reviews. It is ideal for learning how to handle complex service interactions, including:
The @capire/orders package is a standalone service designed to demonstrate advanced domain modeling and data serving techniques:
The @capire/bookstore package is a composite application that demonstrates how to reuse and combine multiple specialized packages. It integrates:
@capire/bookshop@capire/reviews@capire/orders@capire/common@capire/data-viewerIt also demonstrates how to serve various UI technologies, including Vue.js apps (from bookshop, reviews, and data-viewer) and SAP Fiori elements (from orders).
For developers building Fiori applications, this sample introduces:
.cds files.cds watch command.cds watchThe repository is structured as an all-in-one monorepo where each subdirectory is a standard npm package. Some packages have local dependencies on other samples within the repository.
To set up the entire environment and link all local packages, run npm install from the root directory. This will populate the local node_modules and configure local links, allowing the individual sample packages to resolve their dependencies from the local subfolders instead of an external registry.
npm installThe @capire/bookshop package serves as a foundational guide for getting started with the SAP Cloud Application Programming Model (CAP). It covers the core lifecycle of a CAP project, including: