Skip to content

Commit d78f204

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

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,7 +15,10 @@ 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
* [Cluster support](#cluster-support)
20+
* [Logging](#logging)
21+
* [Building](#building)
1922
* [Where to get help](#where-to-get-help)
2023

2124
## Getting started
@@ -286,12 +289,41 @@ client.syncOps().insert(45, Arrays.asList(1, 1));
286289
The client does its best to catch the moment when there are no pending responses
287290
and perform a reconnection.
288291
289-
## Where to get help
292+
## Logging
290293
291-
Got problems or questions? Post them on
292-
[Stack Overflow](http://stackoverflow.com/questions/ask/advice) with the
293-
`tarantool` and `java` tags, or use these tags to search the existing knowledge
294-
base for possible answers and solutions.
294+
The connector uses its own logging facade to abstract from any logging libraries
295+
which can be used inside the apps where the connector attached. At the moment,
296+
the facade supports JUS as a default logging system, SLF4J facade, and Logback
297+
directly via SLF4J interface.
298+
299+
### Logging integration
300+
301+
The logging facade offers several ways in integrate its internal logging with foreign one in order:
302+
303+
* Using system property `org.tarantool.logging.provider`. Supported values are *jdk* and *slf4j*
304+
for the java util logging and SLF4J/Logback respectively. For instance, use
305+
`java -Dorg.tarantool.logging.provider=slf4j <...>`.
306+
307+
* Using Java SPI mechanism. Implement your own provider org.tarantool.logging.LoggerProvider
308+
To register your provider save `META-INF.services/org.tarantool.logging.LoggerProvider` file
309+
with a single line text contains a fully-qualified class name of the provider implementation.
310+
311+
```bash
312+
cat META-INF/services/org.tarantool.logging.LoggerProvider
313+
org.mydomain.MySimpleLoggerProvider
314+
```
315+
316+
* CLASSPATH exploring. Now, the connector will use SLF4J if Logback is also in use.
317+
318+
* If nothing is successful JUL will be used by default.
319+
320+
### Supported loggers
321+
322+
| Logger name | Level | Description |
323+
| ---------------------------------------------- | ----- | ------------------------------------------------- |
324+
| o.t.c.TarantoolClusterStoredFunctionDiscoverer | WARN | prints out invalid discovery addresses |
325+
| o.t.TarantoolClusterClient | TRACE | prints out request retries after transient errors |
326+
| o.t.TarantoolClientImpl | WARN | prints out reconnect issues |
295327
296328
## Building
297329
@@ -306,3 +338,10 @@ To run integration tests use:
306338
```bash
307339
./mvnw clean verify
308340
```
341+
342+
## Where to get help
343+
344+
Got problems or questions? Post them on
345+
[Stack Overflow](http://stackoverflow.com/questions/ask/advice) with the
346+
`tarantool` and `java` tags, or use these tags to search the existing knowledge
347+
base for possible answers and solutions.

0 commit comments

Comments
 (0)