Vaadin logs

Hi All,

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.

Thanks

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.

Henri, thank you for getting back to me.

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.

My log4j.xml contains the logger set to debug:

<logger name="com.vaadin" additivity="false">
<level value="debug" />
<appender-ref ref="vaadin" />
</logger>

and the appender:

<appender name="vaadin" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/var/log/server/vaadin.log" />
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d - %p - [%c %x]
 - %m%n" />
</layout>
</appender>

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.

the java.util.logging.config.file is not the same as log4j config files .

A sample of what my dev java.util.logging.config.file looks like.


#GlassFish logging.properties list
#Thu Aug 29 13:51:22 SAST 2013
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.formatter=com.sun.enterprise.server.logging.UniformLogFormatter
com.sun.enterprise.server.logging.GFFileHandler.logFormatDateFormat=yyyy-MM-dd'T'HH\:mm\:ss.SSSZ
com.sun.enterprise.server.logging.GFFileHandler.flushFrequency=1
javax.enterprise.system.ssl.security.level=INFO
org.apache.jasper.level=INFO
org.eclipse.persistence.session.level=INFO
javax.enterprise.system.tools.admin.level=INFO

I dont really use log4j , so I’m not sure if they have an overlapping logger or a way to configure java.util.logging from log4j …

To enable most of the vaadin logging you would add a line like in the java.util.logging.config.file properties file.


com.vaadin=FINER

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.