cancel
Showing results for 
Search instead for 
Did you mean: 

How can I log remote_user in Kibana when using cds.log in a CAP application?

pieterjanssens
Active Participant

There are 3 (!) different packages provided by SAP for logging in CF, yet CAP does not seem to use any of them:

The screenshot of the documentation on CAP + Kibana is showing remote_user to be empty. The logging packages above require different configuration parameters to be set in order to log the req.user.id. I tried by setting env LOG_REMOTE_USER=true like it's documented for cf-nodejs-logging-support and I also tried setting XS_LOG_USER=true like it's documented for @sap/logging, both have no effect.

Please add documentation on how this can be filled (based on req.user.id) using cds.log in CAP.

SamueleBarzaghi
Participant

Hi piejanssens,

Look at this, there is no answer but some info:

https://github.com/SAP/cf-nodejs-logging-support/issues/69

Ciao

Sam

vansyckel
Advisor
Advisor
0 Kudos

Hi piejanssens,

Currently, there is no API/ config for this. I'll take as feature request.

Best,
Sebastian

Accepted Solutions (1)

Accepted Solutions (1)

vansyckel
Advisor
Advisor

Hi piejanssens,

From our changelog:

  • [cds@5.6.0] Kibana formatter: log the user’s id via cds.env.log.user = true (beta)
    - Consider the data privacy implications!

Best,
Sebastian

iwona_hahn
Product and Topic Expert
Product and Topic Expert

Hi Pieter,

Here comes now also the documentation.

Best regards,
Iwona

Answers (0)