You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,15 @@ This is a collection of support libraries for node.js applications running on Cl
9
9
For details on the concepts and log formats, please look at the sibling project for [java logging support](https://github.com/SAP/cf-java-logging-support).
10
10
11
11
#### Version 2.0 introduced logging without Winston and changed custom fields to be parsed and reported as strings regardless of original type.
12
-
#### Version 3.0 introduced dynamic log levels, sensitive data reduction and a redesigned field configuration system
12
+
#### Version 3.0 introduced dynamic log level thresholds, sensitive data reduction and a redesigned field configuration system
13
13
#### Version 4.0 changed winston transport api
14
14
15
15
## Features
16
16
17
17
* Network logging (http requests) for CloudFoundry
18
18
* Custom message logging
19
19
* Logging levels
20
-
* Dynamic logging level (per request)
20
+
* Dynamic logging level threshold (per request)
21
21
* Extendable field configuration
22
22
* Sensitive data reduction
23
23
* Can be bound to [Winston](https://github.com/winstonjs/winston) as transport
@@ -166,16 +166,16 @@ In order to activate normal logging for all or some of these fields, you have to
166
166
167
167
This behavior matches with the corresponding mechanism in the [CF Java Logging Support](https://github.com/SAP/cf-java-logging-support/wiki/Overview#logging-sensitive-user-data) library.
168
168
169
-
### Dynamic log levels
170
-
Sometimes it is useful to change the logging level for a specific request. This can be achieved by dynamic log levels set by a special header field or directly inside the corresponding request handler.
169
+
### Dynamic logging level threshold
170
+
Sometimes it is useful to change the logging level threshold for a specific request. This can be achieved using a special header field or setting directly within the corresponding request handler. Changing the logging level threshold only affects the presence of logs but not their individual logging levels.
171
171
172
-
#### Change log level via header field
173
-
You can change the log level for a specific request by providing a JSON Web Token ([JWT](https://de.wikipedia.org/wiki/JSON_Web_Token)) via the request header. This way it is not necessary to redeploy your app for every log level change.
172
+
#### Change logging level threshold via header field
173
+
You can change the logging level threshold for a specific request by providing a JSON Web Token ([JWT](https://de.wikipedia.org/wiki/JSON_Web_Token)) via the request header. This way it is not necessary to redeploy your app for every logging level change.
174
174
175
175
##### 1 Creating a JWT
176
-
JWTs are signed claims, which consists of a header, a payload and a signature. You can create JWTs by using the [TokenCreator](https://github.com/SAP/cf-nodejs-logging-support/tree/master/tools/token-creator) from the tools folder.
176
+
JWTs are signed claims, which consist of a header, a payload and a signature. You can create JWTs by using the [TokenCreator](https://github.com/SAP/cf-nodejs-logging-support/tree/master/tools/token-creator) from the tools folder.
177
177
178
-
Basically, JWTs are signed with RSA or HMAC signing algorithms. But we decided to support RDA algorithms (RS256, RS384 and RS512) only. In contrast to HMAC algorithms (HS256, HS384 and HS512), RSA algorithms are asymmetric and therefore require key pairs (public and private key).
178
+
Basically, JWTs are signed using RSA or HMAC signing algorithms. But we decided to support RSA algorithms (RS256, RS384 and RS512) only. In contrast to HMAC algorithms (HS256, HS384 and HS512), RSA algorithms are asymmetric and therefore require key pairs (public and private key).
179
179
180
180
The tool mentioned above takes a log level, creates a key pair and signs the resulting JWT with the private key. The payload of a JWT looks like this:
181
181
```
@@ -198,16 +198,16 @@ DYN_LOG_LEVEL_KEY: <your public key>
198
198
Redeploy your app after setting up the environment variable.
199
199
200
200
##### 3 Attaching JWTs to requests
201
-
Provide the created JWTs via a header field named 'SAP-LOG-LEVEL'. The logging level will be set to the provided level for the request (and also corresponding custom log messages).
201
+
Provide the created JWTs via a header field named 'SAP-LOG-LEVEL'. The logging level threshold will be set to the provided level for the request (and also corresponding custom log messages).
202
202
203
-
Note: If the provided JWT cannot be verified, is expired or contains an invalid logging level, the library ignores it and uses the global logging level.
203
+
Note: If the provided JWT cannot be verified, is expired or contains an invalid logging level, the library ignores it and uses the global logging level threshold.
204
204
205
-
If you want to use another header name for the JWT, you can specify it via an enviroment variable:
205
+
If you want to use another header name for the JWT, you can specify it using an enviroment variable:
206
206
```
207
207
DYN_LOG_HEADER: MY-HEADER-FIELD
208
208
```
209
209
210
-
#### Change log level within request handler
210
+
#### Change logging level threshold within request handlers
211
211
You can also change the log level for all requests of a specific request handler by calling:
0 commit comments