aboutsummaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorMartin Vysny <martin@vysny.me>2019-04-01 22:07:59 +0300
committerPekka Hyvönen <pekka@vaadin.com>2019-04-01 22:07:59 +0300
commit7d2b6cafc57f01a4f31a7afc490573fdd42f0032 (patch)
treec0c044c973cb47b61d5fc4202675a2c638e5f07a /documentation
parent47711930328c045fa97aa77054dcf2db05d5fe28 (diff)
downloadvaadin-framework-7d2b6cafc57f01a4f31a7afc490573fdd42f0032.tar.gz
vaadin-framework-7d2b6cafc57f01a4f31a7afc490573fdd42f0032.zip
Init logging in VaadinServlet instead of an UI (#11525)
If you use multiple UIs, the use of SLF4J would depend on the UI initialization order which could be pretty random. If you have multiple servlets, it's even better to init SLF4J in ServletContextListener.
Diffstat (limited to 'documentation')
-rw-r--r--documentation/advanced/advanced-logging.asciidoc9
1 files changed, 4 insertions, 5 deletions
diff --git a/documentation/advanced/advanced-logging.asciidoc b/documentation/advanced/advanced-logging.asciidoc
index 1dec2e61ac..d0bf217761 100644
--- a/documentation/advanced/advanced-logging.asciidoc
+++ b/documentation/advanced/advanced-logging.asciidoc
@@ -57,11 +57,9 @@ to log the actual messages using Log4j. For more info on this, please visit the
SLF4J site.
In order to get the [package]#java.util.logging# to SLF4J bridge installed, you
-need to add the following snippet of code to your [classname]#UI# class at the
+need to add the following snippet of code to your [classname]#VaadinServlet# class at the
very top:
-//TODO: Sure it's UI class and not the servlet?
-
[source, java]
----
static {
@@ -70,8 +68,9 @@ very top:
----
This will make sure that the bridge handler is installed and working before
-Vaadin starts to process any logging calls.
-
+Vaadin starts to process any logging calls. If your app consists of multiple servlets,
+you should initialize the SLF4J logging in a [classname]#ServletContextListener# instead,
+so that the servlets' initialization methods uses the proper logger.
[WARNING]
.Please note!