I have researched quite a bit and I can’t seem to find a definitive answer:
Does Vaadin itself log anything?
We are experiencing performance issues with our vaadin application and was hoping vaadin had its own logger / log file, to assist us in tracing what is happening. For example, spring has its own logger, mybatis has its own logger, etc. Anything of this nature might be quite helpful to us.
I have tried adding an appender to my log4j.xml i.e. com.vaadin but nothing is populating the logs.
Vaadin uses java.util.logging for what it does log, usually this ends up in the server log if you haven’t configured otherwise. You should be able to specify an alternate JUL config file e.g. with -Djava.util.logging.config.file=/path/to/app.properties for the server JVM if you want to customize logging.
Some things are logged in more detail than others, though, so YMMV with respect to whether you get what you want.
I have added the -Djava.util.logging.config.file=/path/to/log4j.xml (pointing to my log4j.xml inside of my application) to my tomcat startup script as this is where we set the arguments normally.
Yet I still don’t see any logs for vaadin. Am I using the wrong logger name? I have also set up a root logger, which should catch anything, and nothing is printed to that log either.
Perhaps I haven’t followed your instructions properly. Is there any light you could shed on this?
java.util.logging (JUL for short) is not log4j, and it uses a different configuration file format, different appenders etc.
There are some ways to forward messages between JUL, log4j, slf4j etc. common logging frameworks if you want - a quick search e.g. for “configuring java.util.logging” and “java.util.logging log4j” should give some pointers.
Henri Sara,
How to configure log4j.properties file in maven vaadin application.i want to deploy in tomcat, the log file must created with in the tomcat logs folder with the user defined name.
soundarc soundar:
Henri Sara,
How to configure log4j.properties file in maven vaadin application.i want to deploy in tomcat, the log file must created with in the tomcat logs folder with the user defined name.
Have you found solution to this problem. I am trying to implement the log to file using log4j but file appender path is not working.