Skip to content

Commit abacc5c

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

File tree

1 file changed

+44
-5
lines changed

1 file changed

+44
-5
lines changed

README.md

Lines changed: 44 additions & 5 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
@@ -348,12 +351,41 @@ client.syncOps().insert(45, Arrays.asList(1, 1));
348351
The client does its best to catch the moment when there are no pending responses
349352
and perform a reconnection.
350353
351-
## Where to get help
354+
## Logging
352355
353-
Got problems or questions? Post them on
354-
[Stack Overflow](http://stackoverflow.com/questions/ask/advice) with the
355-
`tarantool` and `java` tags, or use these tags to search the existing knowledge
356-
base for possible answers and solutions.
356+
The connector uses its own logging facade to abstract from any logging libraries
357+
which can be used inside the apps where the connector attached. At the moment,
358+
the facade supports JUL as a default logging system, SLF4J facade, and Logback
359+
directly via SLF4J interface.
360+
361+
### Logging integration
362+
363+
The logging facade offers several ways in integrate its internal logging with foreign one in order:
364+
365+
* Using system property `org.tarantool.logging.provider`. Supported values are *jdk* and *slf4j*
366+
for the java util logging and SLF4J/Logback respectively. For instance, use
367+
`java -Dorg.tarantool.logging.provider=slf4j <...>`.
368+
369+
* Using Java SPI mechanism. Implement your own provider org.tarantool.logging.LoggerProvider
370+
To register your provider save `META-INF.services/org.tarantool.logging.LoggerProvider` file
371+
with a single line text contains a fully-qualified class name of the provider implementation.
372+
373+
```bash
374+
cat META-INF/services/org.tarantool.logging.LoggerProvider
375+
org.mydomain.MySimpleLoggerProvider
376+
```
377+
378+
* CLASSPATH exploring. Now, the connector will use SLF4J if Logback is also in use.
379+
380+
* If nothing is successful JUL will be used by default.
381+
382+
### Supported loggers
383+
384+
| Logger name | Level | Description |
385+
| ---------------------------------------------- | ----- | ------------------------------------------------- |
386+
| o.t.c.TarantoolClusterStoredFunctionDiscoverer | WARN | prints out invalid discovery addresses |
387+
| o.t.TarantoolClusterClient | TRACE | prints out request retries after transient errors |
388+
| o.t.TarantoolClientImpl | WARN | prints out reconnect issues |
357389
358390
## Building
359391
@@ -368,3 +400,10 @@ To run integration tests use:
368400
```bash
369401
./mvnw clean verify
370402
```
403+
404+
## Where to get help
405+
406+
Got problems or questions? Post them on
407+
[Stack Overflow](http://stackoverflow.com/questions/ask/advice) with the
408+
`tarantool` and `java` tags, or use these tags to search the existing knowledge
409+
base for possible answers and solutions.

0 commit comments

Comments
 (0)