We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm trying to use the Logger interface by following https://sap.github.io/cloud-sdk/docs/js/features/logging, as mentioned The SAP Cloud SDK sets default values for format and transports parts. The transport is set to console and the format is set to local or kibana.
format
transports
Since I'm running the application locally without VCAP_SERVICE variable, I assume that it is using local as format.
local
Here is part of the code.
const { createLogger } = require('@sap-cloud-sdk/util'); const logger = createLogger('saas-registry'); logger.log('info', '%s', 'abc');
It output the message as below. The string interpolation is not working here.
[2022-05-05T08:47:56.784Z] INFO (saas-registry): %s
If I used winston module directly:
winston
const { createLogger, format, transports } = require('winston'); const logger = createLogger({ defaultMeta: { service: 'saas-registry' }, format: format.combine( format.splat(), format.simple() ), transports: [new transports.Console()] }); logger.log('info', '%s', 'abc');
It output the message as below and the string interpolation worked:
info: abc {"service":"saas-registry"}
Version information @sap-cloud-sdk/core ==> "version": "1.54.0" @sap/cds ==> "version": "5.9.2"
The text was updated successfully, but these errors were encountered:
Hi @zpq2004 ,
Thanks for raising this. The SDK logger's formats currently do not support string interpolation by default. I will create a backlog item for this.
FYI @marikaner
Regards, Deeksha
Sorry, something went wrong.
No branches or pull requests
Hi,
I'm trying to use the Logger interface by following https://sap.github.io/cloud-sdk/docs/js/features/logging, as mentioned The SAP Cloud SDK sets default values for
format
andtransports
parts. The transport is set to console and the format is set to local or kibana.Since I'm running the application locally without VCAP_SERVICE variable, I assume that it is using
local
as format.Here is part of the code.
It output the message as below. The string interpolation is not working here.
If I used
winston
module directly:It output the message as below and the string interpolation worked:
Version information
@sap-cloud-sdk/core ==> "version": "1.54.0"
@sap/cds ==> "version": "5.9.2"
The text was updated successfully, but these errors were encountered: