Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from sxwei123/develop
Browse files Browse the repository at this point in the history
Update readme and comments
  • Loading branch information
sxwei123 authored Jan 2, 2021
2 parents 73c7d69 + a33e50f commit c89bf7e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,30 @@ yarn add azure-log-analytics-data-collector-client

## Usage

Javascript:

```js
const {
DataCollectorClient,
} = require("azure-log-analytics-data-collector-client");

const client = new DataCollectorClient(
"WORKSPACE_ID",
"PRIMARY_KEY_OR_SECONDARY_KEY"
);

client
.send("MyLogs", [
{
level: "info",
message: "server starts",
},
])
.then(console.log);
```

Typescript:

```ts
import { DataCollectorClient } from "azure-log-analytics-data-collector-client";

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azure-log-analytics-data-collector-client",
"version": "2.2.0",
"version": "2.2.1",
"description": "Node.js wrapper for Azure Log Analytics data collector API",
"main": "./dist/index.js",
"exports": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class DataCollectorClient {
* @param logs The logs in JSON array
* @param timeGenerated The name of a field in the data that contains the timestamp of the data item. If you specify a field then its contents are used for TimeGenerated. If this field isn’t specified, the default for TimeGenerated is the time that the message is ingested. The contents of the message field should follow the ISO 8601 format YYYY-MM-DDThh:mm:ssZ.
*
* @returns The request status code. Refer to: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-collector-api#return-codes
* @returns An object contains http status and status code
*/
async send(
logType: string,
Expand Down

0 comments on commit c89bf7e

Please sign in to comment.