Skip to content

Commit 21f27e6

Browse files
committed
Logging docs
Add basic info about supported logging system in the connector. Follows on: #194
1 parent c485c76 commit 21f27e6

File tree

1 file changed

+45
-6
lines changed

1 file changed

+45
-6
lines changed

README.md

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ To get the Java connector for Tarantool 1.6.9, visit
1515

1616
## Table of contents
1717
* [Getting started](#getting-started)
18+
* [Spring NamedParameterJdbcTemplate usage example](#spring-namedparameterjdbctemplate-usage-example)
1819
* [JDBC](#JDBC)
1920
* [Cluster support](#cluster-support)
21+
* [Logging](#logging)
22+
* [Building](#building)
2023
* [Where to get help](#where-to-get-help)
2124

2225
## Getting started
@@ -395,7 +398,7 @@ client.syncOps().insert(45, Arrays.asList(1, 1));
395398
The client does its best to catch the moment when there are no pending responses
396399
and perform a reconnection.
397400
398-
### Client config options
401+
### Cluster client config options
399402
400403
In addition to the options for [the standard client](#client-config-options), cluster
401404
config provides some extra options:
@@ -409,12 +412,41 @@ config provides some extra options:
409412
cluster nodes.
410413
Default value is `60 * 1000` (1 minute).
411414
412-
## Where to get help
415+
## Logging
413416
414-
Got problems or questions? Post them on
415-
[Stack Overflow](http://stackoverflow.com/questions/ask/advice) with the
416-
`tarantool` and `java` tags, or use these tags to search the existing knowledge
417-
base for possible answers and solutions.
417+
The connector uses its own logging facade to abstract from any logging libraries
418+
which can be used inside the apps where the connector attached. At the moment,
419+
the facade supports JUL as a default logging system, SLF4J facade, and Logback
420+
directly via SLF4J interface.
421+
422+
### Logging integration
423+
424+
The logging facade offers several ways in integrate its internal logging with foreign one in order:
425+
426+
* Using system property `org.tarantool.logging.provider`. Supported values are *jdk* and *slf4j*
427+
for the java util logging and SLF4J/Logback respectively. For instance, use
428+
`java -Dorg.tarantool.logging.provider=slf4j <...>`.
429+
430+
* Using Java SPI mechanism. Implement your own provider org.tarantool.logging.LoggerProvider
431+
To register your provider save `META-INF.services/org.tarantool.logging.LoggerProvider` file
432+
with a single line text contains a fully-qualified class name of the provider implementation.
433+
434+
```bash
435+
cat META-INF/services/org.tarantool.logging.LoggerProvider
436+
org.mydomain.MySimpleLoggerProvider
437+
```
438+
439+
* CLASSPATH exploring. Now, the connector will use SLF4J if Logback is also in use.
440+
441+
* If nothing is successful JUL will be used by default.
442+
443+
### Supported loggers
444+
445+
| Logger name | Level | Description |
446+
| ---------------------------------------------- | ----- | ------------------------------------------------- |
447+
| o.t.c.TarantoolClusterStoredFunctionDiscoverer | WARN | prints out invalid discovery addresses |
448+
| o.t.TarantoolClusterClient | TRACE | prints out request retries after transient errors |
449+
| o.t.TarantoolClientImpl | WARN | prints out reconnect issues |
418450
419451
## Building
420452
@@ -429,3 +461,10 @@ To run integration tests use:
429461
```bash
430462
./mvnw clean verify
431463
```
464+
465+
## Where to get help
466+
467+
Got problems or questions? Post them on
468+
[Stack Overflow](http://stackoverflow.com/questions/ask/advice) with the
469+
`tarantool` and `java` tags, or use these tags to search the existing knowledge
470+
base for possible answers and solutions.

0 commit comments

Comments
 (0)