Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging configuration documentation #406

Merged
merged 1 commit into from Nov 15, 2018

Conversation

furkansenharputlu
Copy link
Contributor

This PR adds documentation for Logging Configuration. #340

Copy link
Member

@Serdaro Serdaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed.

README.md Outdated
@@ -2432,6 +2432,37 @@ config.properties['hazelcast.client.statistics.period.seconds'] = 4;

After enabling the client statistics, you can monitor your clients using Hazelcast Management Center. Please refer to the [Monitoring Clients section](https://docs.hazelcast.org/docs/management-center/latest/manual/html/index.html#monitoring-clients) in the Hazelcast Management Center Reference Manual for more information on the client statistics.

### 7.9.2. Logging Configuration

Hazelcast Node.js client has a flexible logging configuration. You can add your custom loggers by providing adapters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hazelcast Node.js client has a flexible logging configuration: you can add your custom loggers by providing adapters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sentence is redundant: Hazelcast Node.js client has a flexible logging configuration..
I would say It is possible to connect any logging library to Hazelcast Node.js client through adapters.

README.md Outdated

Hazelcast Node.js client has a flexible logging configuration. You can add your custom loggers by providing adapters.

To configure the logger, you need to implement `ILogger` interface in your adapter and add it to `ClientConfig.properties['hazelcast.logging']`. If you set this property to `'off'`, it does not log anything.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To configure a logger, you need to implement the ILogger interface ...

NOTE: I am not sure if my question is reasonable but: Don't we need to show a brief code example on how to implement the ILogger interface and pass it to the properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the below code snippet shows it.

README.md Outdated
@@ -2432,6 +2432,37 @@ config.properties['hazelcast.client.statistics.period.seconds'] = 4;

After enabling the client statistics, you can monitor your clients using Hazelcast Management Center. Please refer to the [Monitoring Clients section](https://docs.hazelcast.org/docs/management-center/latest/manual/html/index.html#monitoring-clients) in the Hazelcast Management Center Reference Manual for more information on the client statistics.

### 7.9.2. Logging Configuration

Hazelcast Node.js client has a flexible logging configuration. You can add your custom loggers by providing adapters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sentence is redundant: Hazelcast Node.js client has a flexible logging configuration..
I would say It is possible to connect any logging library to Hazelcast Node.js client through adapters.

};
config.properties['hazelcast.logging'] = winstonAdapter;
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK it is not possible to configure custom logging via declarative configuration. It is good to state this too. Otherwise, users may waste time trying to find a configuration that does not exist.

@@ -2432,6 +2432,37 @@ config.properties['hazelcast.client.statistics.period.seconds'] = 4;

After enabling the client statistics, you can monitor your clients using Hazelcast Management Center. Please refer to the [Monitoring Clients section](https://docs.hazelcast.org/docs/management-center/latest/manual/html/index.html#monitoring-clients) in the Hazelcast Management Center Reference Manual for more information on the client statistics.

### 7.9.2. Logging Configuration

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before adapters, I think we should show how to turn off logging, hazelcast.logging=off. We would show how to set log levels in default logger but that is not available as of now. So we can show how to turn it off and continue.

README.md Outdated

Also, it is possible to connect any logging library to Hazelcast Node.js client through adapters.

See the following built-in `winston` logging library example.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does built-in mean here? It is not built-in to Hazelcast. It is an external library.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, it is a built-in Node.js library.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a built-in library. We add it explicitly as test dependency, just to test this feature. See: https://github.com/hazelcast/hazelcast-nodejs-client/blob/master/package.json#L26

README.md Outdated

To configure a logger, you need to use the `ClientConfig.properties['hazelcast.logging']` property. If you set it to `'off'`, it does not log anything.

Also, it is possible to connect any logging library to Hazelcast Node.js client through adapters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes:

  • By "any", do we mean actually "any"?
  • Does Node.js client provide some built-in adapters?
  • I am guessing there is a default logger?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it as : By default, there is a Default Logger. Also, it is possible to connect a custom logging library to Hazelcast Node.js client through adapters.

@furkansenharputlu furkansenharputlu merged commit 091f7b6 into hazelcast:master Nov 15, 2018
@furkansenharputlu furkansenharputlu moved this from In progress to Done in 0.10 Nov 15, 2018
harunalpak pushed a commit to harunalpak/hazelcast-nodejs-client that referenced this pull request Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
0.10
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants