Skip to content

Commit

Permalink
changing ``` languages
Browse files Browse the repository at this point in the history
  • Loading branch information
Simplychee committed Oct 9, 2023
1 parent 107f9f3 commit a49f313
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/_include/log-shipping/apprunner-defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ By default, we do not send logs of type START, END, REPORT.

If you prefer to send all log types, replace the method `_parse_apprunner_log` in the Lambda function with the following:

```py
```python
def _parse_apprunner_log(log, additional_data):
# type: (dict, dict) -> bool
_add_timestamp(log)
Expand Down
2 changes: 1 addition & 1 deletion docs/_include/log-shipping/cloudwatch-defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ By default, we do not send logs of type START, END, REPORT.

If you prefer to send all log types, replace the method `_parse_cloudwatch_log` in the Lambda function with the following:

```py
``````python
def _parse_cloudwatch_log(log, additional_data):
# type: (dict, dict) -> bool
_add_timestamp(log)
Expand Down
2 changes: 1 addition & 1 deletion docs/_include/tracing-shipping/dotnet-framework-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Add a required HttpModule to the Web.Config file as follows:

Add the following code to the Global.asax.cs file:

```cs
```csharp
using OpenTelemetry;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
Expand Down
4 changes: 2 additions & 2 deletions docs/_include/tracing-shipping/dotnet-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ dotnet add package OpenTelemetry.Extensions.Hosting

Add the following configuration to the beginning of the Startup.cs file:

```cs
```csharp
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
```

Add the following configuration to the Startup class:

```cs
```csharp
public void ConfigureServices(IServiceCollection services)
{

Expand Down
42 changes: 21 additions & 21 deletions docs/shipping/Code/node-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Use the samples in the code block below as a starting point, and replace the sam

For a complete list of options, see the configuration parameters below the code block.👇

```js
```javascript
// Replace these parameters with your configuration
var logger = require('logzio-nodejs').createLogger({
token: '<<LOG-SHIPPING-TOKEN>>',
Expand Down Expand Up @@ -79,7 +79,7 @@ For more consistent and reliable parsing, we recommend sending logs as objects.

To send an object (recommended):

```js
```javascript
var obj = {
message: 'Some log message',
param1: 'val1',
Expand All @@ -90,21 +90,21 @@ To send an object (recommended):

To send raw text:

```js
```javascript
logger.log('This is a log message');
```

Include this line at the end of the run if you're using logzio-nodejs in a severless environment, such as AWS Lambda, Azure Functions, or Google Cloud Functions:

```js
```javascript
logger.sendAndClose();
```

###### Custom tags

You can add custom tags to your logs using the following format: `{ tags : ['tag1']}`, for example:

```js
```javascript
var obj = {

message: 'Your log message',
Expand Down Expand Up @@ -143,7 +143,7 @@ npm install winston-logzio --save
Here's a sample configuration that you can use as a starting point.
Use the samples in the code block below or replace the sample with a configuration that matches your needs.

```js
```javascript
const winston = require('winston');
const LogzioWinstonTransport = require('winston-logzio');

Expand Down Expand Up @@ -196,24 +196,24 @@ For a complete list of your options, see the configuration parameters below.👇

* If winston-logzio is used as part of a serverless service (AWS Lambda, Azure Functions, Google Cloud Functions, etc.), add this line at the end of the configuration code block.

```js
```javascript
logger.close()
```

* The winston logger by default sends all logs to the console. You can easily disable this by adding this line to your code:

```js
```javascript
winston.remove(winston.transports.Console);
```
* To send a log line:

```js
```javascript
winston.log('info', 'winston logger configured with logzio transport');
```

* To log the last UncaughtException before Node exits:

```js
```javascript
var logzIOTransport = new (winstonLogzIO)(loggerOptions);
var logger = new(winston.Logger)({
transports: [
Expand All @@ -235,7 +235,7 @@ For a complete list of your options, see the configuration parameters below.👇

* Another configuration option

```js
```javascript
var winston = require('winston');
var logzioWinstonTransport = require('winston-logzio');

Expand All @@ -255,7 +255,7 @@ For a complete list of your options, see the configuration parameters below.👇

You can add custom tags to your logs using the following format: `{ tags : ['tag1']}`, for example:

```js
```javascript
var obj = {

message: 'Your log message',
Expand Down Expand Up @@ -295,13 +295,13 @@ npm install winston-logzio --save

If you don't have a `tsconfig.json` file, you'll need to add it first. Start by running:

```js
```javascript
tsc --init
```

On your `tsconfig.json` file, under the parameter `compilerOptions` make sure you have the `esModuleInterop` flag set to `true` or add it:

```js
```javascript
"compilerOptions": {
...
"esModuleInterop": true
Expand All @@ -311,7 +311,7 @@ On your `tsconfig.json` file, under the parameter `compilerOptions` make sure yo
Here's a sample configuration that you can use as a starting point.
Use the samples in the code block below or replace the sample with a configuration that matches your needs.

```js
```javascript
import winston from 'winston';
import LogzioWinstonTransport from 'winston-logzio';
const logzioWinstonTransport = new LogzioWinstonTransport({
Expand All @@ -329,7 +329,7 @@ logger.log('warn', 'Just a test message');

If winston-logzio is used as part of a serverless service (AWS Lambda, Azure Functions, Google Cloud Functions, etc.), add this line at the end of the configuration code block, every time you are using the logger.

```js
```javascript
await logger.info(“API Called”)

logger.close()
Expand Down Expand Up @@ -357,7 +357,7 @@ tsc --project tsconfig.json

You can add custom tags to your logs using the following format: `{ tags : ['tag1']}`, for example:

```js
```javascript
var obj = {

message: 'Your log message',
Expand Down Expand Up @@ -400,7 +400,7 @@ npm install [email protected]

Add the following code to your application:

```js
```javascript
const MeterProvider = require('@opentelemetry/sdk-metrics-base');
const sdk = require('logzio-nodejs-metrics-sdk');

Expand Down Expand Up @@ -441,7 +441,7 @@ To add a required metric to your code, copy and paste the required metric code t

#### Counter

```js
```javascript
// Create your first counter metric
const requestCounter = meter.createCounter('Counter', {
description: 'Example of a Counter',
Expand All @@ -456,7 +456,7 @@ requestCounter.add(1,labels);

#### UpDownCounter

```js
```javascript
// Create UpDownCounter metric
const upDownCounter = meter.createUpDownCounter('UpDownCounter', {
description: 'Example of a UpDownCounter',
Expand All @@ -472,7 +472,7 @@ upDownCounter.add(-1,labels);

#### Histogram:

```js
```javascript
// Create ValueRecorder metric
const histogram = meter.createHistogram('test_histogram', {
description: 'Example of a histogram',
Expand Down

0 comments on commit a49f313

Please sign in to comment.