Skip to content
New issue

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

Clear (my) confusion: cf-nodejs-logging-support vs @sap/logging #93

Open
piejanssens opened this issue Oct 7, 2021 · 7 comments
Open
Labels

Comments

@piejanssens
Copy link

piejanssens commented Oct 7, 2021

What is the actual difference between these packages and the proper use-case for each?

I have used @sap/logging and actually ended up in this repo per accident looking for specific documentation on logging REMOTE_USER.

@piejanssens piejanssens changed the title Clear confusion: cf-nodejs-logging-support vs @sap/logging Clear (my) confusion: cf-nodejs-logging-support vs @sap/logging Oct 7, 2021
@piejanssens
Copy link
Author

It seems for CAP applications, none of these are used (looking at the dependency tree), het logging to the CF Logging service works: https://cap.cloud.sap/docs/node.js/cds-log#cds-logger

@juergen-walter
Copy link
Member

The cf-nodejs-logging-support library targets the Application Logging service for Cloud Foundry applications.

Afaik there is no good integration between CAP and this library but @KarstenSchnitter @nicklas-dohrn can probably add more beef to my statement.

@piejanssens
Copy link
Author

piejanssens commented Oct 12, 2021

FYI In the meanwhile I have raised the question regarding the REMOTE_USER in CAP here: https://answers.sap.com/questions/13497765/3-different-packages-provided-by-sap-for-logging-i.html

I don't see any added value of having @sap/logging around if cf-nodejs-logging-support is the pkg to target Application Logging service. Why would someone still want to use @sap/logging?

It would be good to avoid confusion if @sap/logging was deprecated and cf-nodejs-logging-support got a better name such as @sap/application-logging.

It would benefit everyone if sap-cloud-sdk and @sap/cds actually used this package instead of each having their own take on implementing an integration with the Application Logging service.

@juergen-walter
Copy link
Member

We get your issue, it is not nice from a CAP customer side.

The Application Logging service documentation points to the correct libraries
https://help.sap.com/viewer/ee8e8a203e024bbb8c8c2d03fce527dc/Cloud/en-US/d39c8a44992c4dbd86667b03ca5ab69a.html

We cannot say much about @sap/logging yet, we try to figure out. I think the pointers should be fixed on CAP side.

@gregorwolf
Copy link

Hi @juergen-walter,

this issue is open now for about 10 month. Is the clarification still ongoing or what is the result? Heve you taled to the CAP colleagues?

@juergen-walter
Copy link
Member

There are two not 100% compatible use cases: Using CAP and Application Logging. Therefore, there are two libraries arround.

https://www.npmjs.com/package/@sap/logging
"A package that provides logging and tracing functionalities for Node.js applications."
--> It is included in SAP Cloud Application Programming Model (CAP)

https://www.npmjs.com/package/cf-nodejs-logging-support
"provides a bundle of targeted logging services for node.js applications running on Cloud Foundry"
--> Targets SAP Application Logging service for SAP BTP(would work for any other Elasticsearch or OpenSearch based service)

The libraries cannot be compatible as long as the services are not compatible.

@gregorwolf
Copy link

Hello @juergen-walter,

as far as I can see from sap/[email protected]/package.json CAP has no dependency to @sap/logging. Based on the documentation CAP Service SDK for Node.js -> Minimalistic Logging Facade the logging functionality is provided by CAP itself. With Kibana-Friendly Formatter it seems also to provide the needed data for the SAP Application Logging -> Fields. Maybe @danjoa can add his insights here.

Best Regards
Gregor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants