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
Add logging configuration documentation #406
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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; | ||
``` | ||
|
There was a problem hiding this comment.
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 | |||
|
There was a problem hiding this comment.
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.
95081a3
to
dbed573
Compare
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
dbed573
to
5967def
Compare
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
5967def
to
65fdebe
Compare
This PR adds documentation for Logging Configuration. #340