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
@@ -15,51 +15,50 @@ have to jump a couple of legal hurdles.
15
15
Please fill out either the individual or corporate Contributor License Agreement
16
16
(CLA).
17
17
18
-
* If you are an individual writing original source code and you're sure you
19
-
own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual).
20
-
* If you work for a company that wants to allow you to contribute your work,
21
-
then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate).
18
+
* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual).
19
+
* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate).
22
20
23
21
Follow either of the two links above to access the appropriate CLA and
24
22
instructions for how to sign and return it. Once we receive it, we'll be able to
25
23
accept your pull requests.
26
24
27
25
## Contributing A Patch
28
26
29
-
1. Submit an issue describing your proposed change to the repo in question.
30
-
1. The repo owner will respond to your issue promptly.
31
-
1. If your proposed change is accepted, and you haven't already done so, sign a
32
-
Contributor License Agreement (see details above).
33
-
1. Fork the desired repo, develop and test your code changes.
34
-
1. Ensure that your code adheres to the existing style in the code to which
35
-
you are contributing.
36
-
1. Ensure that your code has an appropriate set of tests which all pass.
37
-
1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling.
38
-
1. Submit a pull request.
27
+
1. Submit an issue describing your proposed change to the repo in question.
28
+
1. The repo owner will respond to your issue promptly.
29
+
1. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above).
30
+
1. Fork the desired repo, develop and test your code changes.
31
+
1. Ensure that your code adheres to the existing style in the code to which you are contributing.
32
+
1. Ensure that your code has an appropriate set of tests which all pass.
33
+
1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling.
34
+
1. Submit a pull request.
39
35
40
36
## Running the tests
41
37
42
-
1.[Prepare your environment for Node.js setup][setup].
38
+
1.[Prepare your environment for Node.js setup][setup].
// Create a middleware that will use the provided logger.
121
-
// A Stackdriver Logging transport will be created automatically
115
+
// A Cloud Logging transport will be created automatically
122
116
// and added onto the provided logger.
123
117
constmw=awaitlw.express.makeMiddleware(logger);
124
118
// Alternatively, you can construct a LoggingWinston transport
@@ -138,7 +132,7 @@ async function main() {
138
132
app.get('/', (req, res) => {
139
133
// `req.log` can be used as a winston style log method. All logs generated
140
134
// using `req.log` use the current request context. That is, all logs
141
-
// corresponding to a specific request will be bundled in the Stackdriver
135
+
// corresponding to a specific request will be bundled in the Cloud
142
136
// UI.
143
137
req.log.info('this is an info log message');
144
138
res.send('hello world');
@@ -159,7 +153,7 @@ main();
159
153
160
154
### Error Reporting
161
155
162
-
Any `Error` objects you log at severity `error` or higher can automatically be picked up by [Stackdriver Error Reporting](https://cloud.google.com/error-reporting/) if you have specified a `serviceContext.service` when instantiating a `LoggingWinston` instance:
156
+
Any `Error` objects you log at severity `error` or higher can automatically be picked up by [Cloud Error Reporting](https://cloud.google.com/error-reporting/) if you have specified a `serviceContext.service` when instantiating a `LoggingWinston` instance:
163
157
164
158
```javascript
165
159
constloggingWinston=newLoggingWinston({
@@ -182,7 +176,7 @@ You may also want to see the [@google-cloud/error-reporting](https://github.com/
182
176
183
177
**NOTE: The express middleware provided by this library handles this automatically for you. These instructions are for there case where you may want to handle this manually.**
184
178
185
-
To format your request logs you can provide a `httpRequest` property as part of the log metadata you provide to winston. We will treat this as the [`HttpRequest`](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest) message and Stackdriver logging will show this as a request log. Example:
179
+
To format your request logs you can provide a `httpRequest` property as part of the log metadata you provide to winston. We will treat this as the [`HttpRequest`](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest) message and Cloud logging will show this as a request log. Example:
@@ -204,7 +198,7 @@ The `httpRequest` property must be a properly formatted [`HttpRequest`](https://
204
198
205
199
**NOTE: The express middleware provided by this library handles this automatically for you. These instructions are for there case where you may want to handle this manually.**
206
200
207
-
If you use [@google-cloud/trace-agent][trace-agent] module, then this module will set the Stackdriver Logging [LogEntry][LogEntry]`trace` property based on the current trace context when available. That correlation allows you to [view log entries][trace-viewing-log-entries] inline with trace spans in the Stackdriver Trace Viewer. Example:
201
+
If you use [@google-cloud/trace-agent][trace-agent] module, then this module will set the Cloud Logging [LogEntry][LogEntry]`trace` property based on the current trace context when available. That correlation allows you to [view log entries][trace-viewing-log-entries] inline with trace spans in the Cloud Trace Viewer. Example:
208
202
209
203

You can specify `labels` when initiating the logger constructor.
227
221
228
222
```js
229
-
// Creates a Winston Stackdriver Logging client
223
+
// Creates a Winston Cloud Logging client
230
224
constloggingWinston=newLoggingWinston({
231
225
labels: {
232
226
name:'some-name',
@@ -255,7 +249,7 @@ The `labels` will be on the Log Viewer.
255
249
You can specify a `prefix` in the constructor, and that `prefix` will be prepended to all logging messages. This can be helpful, for example, to quickly identify logs from different modules in a project.
256
250
257
251
```js
258
-
// Creates a Winston Stackdriver Logging client
252
+
// Creates a Winston Cloud Logging client
259
253
constloggingWinston=newLoggingWinston({
260
254
prefix:'some-module'
261
255
});
@@ -265,7 +259,6 @@ logger.debug('test msg');
265
259
266
260

267
261
268
-
269
262
## Samples
270
263
271
264
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-logging-winston/tree/master/samples) directory. The samples' `README.md`
@@ -276,9 +269,7 @@ has instructions for running the samples.
276
269
| Quickstart |[source code](https://github.com/googleapis/nodejs-logging-winston/blob/master/samples/quickstart.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-logging-winston&page=editor&open_in_editor=samples/quickstart.js,samples/README.md)|
277
270
| Explicit Auth Setup |[source code](https://github.com/googleapis/nodejs-logging-winston/blob/master/samples/setup_explicit.js)|[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-logging-winston&page=editor&open_in_editor=samples/setup_explicit.js,samples/README.md)|
278
271
279
-
280
-
281
-
The [Stackdriver Logging for Winston Node.js Client API Reference][client-docs] documentation
272
+
The [Cloud Logging for Winston Node.js Client API Reference][client-docs] documentation
0 commit comments