## 7.1.5.1 Enable and Provide Application Logs
If there are authentication problems in your application, enable logging for the container security library in question, reproduce the problem, and attach the application logs. To obtain more details, set the environment variables for the application.
## Context
##  Tip
We also provide a log collector script , that helps you to increase the log verbosity of your application and application router.
## Procedure
1. Open a command prompt.
2. Log on to your Cloud Foundry environment using the Cloud Foundry command line interface (CLI). For more information, see Log On to the Cloud Foundry Environment Using the Cloud Foundry Command Line Interface [page 2534].
3. Choose your organization.
##  Note
The Cloud Foundry command line interface prompts you to choose an org. To find the org of your subaccount, use the SAP BTP cockpit to go to your subaccount. You find the org in the Cloud Foundry tile under Organization (see Navigate to Orgs and Spaces [page 2512]).
4. Choose the space where the application is located.
5. To route the log messages to the standard output, use the following command:
6. To set the log level, use the following command:
7. (For Node.js) To set detailed logs of the Security API for Node.js, use the following command:
```
cf set-env <application_name> SAP_EXT_TRC stdout
```
```
 Example cf set-env your-app SAP_EXT_TRC stdout
```
```
cf set-env <application_name> SAP_EXT_TRL 3
```
```
 Example cf set-env your-app SAP_EXT_TRL 3
```
```
cf set-env <application_name> DEBUG xssec*
```

Example cf set-env your-app DEBUG xssec*
8. Restage your application using the following command:
cf restage &lt;application&gt;

Example cf restage your-app
Restaging the application enables the display of the logs.
9. We recommend piping the output to a log file. Use the following command to do this:
10. Reproduce the problem in your application. The events that occur in your application are logged in your local log file.
11. Create an incident for your local support. Create an incident using the component BC-CP-CF-SEC-IAM . Use the SAP Support Portal . For more information, see Monitoring and Troubleshooting [page 3194].
12. Attach the log files to the incident.
```
cf logs <application> > <log_file_name>  Example cf logs your-app > your-app-log.txt
```
<!-- image -->
To obtain more details about the token validation, set the following environment variables of the container security library and Node.js (if applicable):
SAPSSOEXT Environment Variables
Environment Variables
SAP\_EXT\_TRC
Description
Enablement of logs
| Environment Variables                               | Description                                                                                          |
|-----------------------------------------------------|------------------------------------------------------------------------------------------------------|
| SAP_EXT_TRL                                         | Log level ranging from off to high Values (integer): • 0 (off) • 1 (default) • 2 (medium) • 3 (high) |
| Node.js Environment Variables Environment Variables | Description                                                                                          |
| DEBUG                                               | Detailed logs of the security API for Node.js Value (string): xssec*                                 |