Log4j
Log4j is a very widely used Java library to enable logging functionality. It allows an administrator to easily configure logging details like the logging format, the use of log files (use a single file, use a different file each day, use a file until it reaches a certain size, etc.)
By default logs will appear in jasperserver.log (
Online/Temporary: This is to make temporary changes to log4j properties. The settings take effect immediately and will be reset after JasperReports Server is restarted. As a privileged user, browse to the web page 'http://<hostname>:8080/jasperserver-pro/log_settings.html' and make your desired changes. In JasperReports Server version v4.0 and above (logged in as superuser) simply click "Manage -> Log Settings".
or
- Offline/Permanent: Edit log4j.properties located in
\webapps\jasperserver-pro\WEB-INF\log4j.properties. Make sure to restart or reload the application server (eg Tomcat) in order for any changes in the properties file to take place.
If you are troubleshooting an issue that prevents JasperReports Server from starting, then you won't be able to use the JasperReports Server logger. You need to refer to the application server log files instead. For Tomcat 5.5 these are found in <tomcat>/logs.
JasperReports Server log4j recommendations
- Normally you enable a particular logger by uncommenting the sample line included in log4j.properties.
- When debugging something difficult, the sledgehammer approach is to set log4j.rootLogger (the last line in log4j.properties) to 'debug' instead of 'warn'. This will probably give you what you need... but it will certainly give you many many things that you don't need. Use sledgehammers with care.
Selected log4j.properties notes
This table is based on log4j.properties from JasperReports Server Enterprise. Most logger properties are commented out by default. This chart is not comprehensive; it is intended to provide comments on some existing options and to document some available loggers which do not appear by default (in either commented or uncommented form).
Setting | Comment |
---|---|
log4j.rootLogger=WARN, stdout, fileout | set global defaults |
#log4j.logger.org.springframework.aop.framework.autoproxy=DEBUG, stdout, fileout | |
#log4j.logger.org.springframework.aop.framework.autoproxy.metadata=DEBUG, stdout, fileout | |
#log4j.logger.org.springframework.aop.framework.autoproxy.target=DEBUG, stdout, fileout | |
#log4j.logger.org.springframework.transaction.interceptor=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.intercept=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.intercept.method=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.intercept.web=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.afterinvocation=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.acl=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.acl.basic=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.taglibs.authz=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.ui.basicauth=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.ui.rememberme=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.ui=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.afterinvocation=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.ui.rmi=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.ui.httpinvoker=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.util=DEBUG, stdout, fileout | |
#log4j.logger.org.acegisecurity.providers.dao=DEBUG, stdout, fileout | |
#log4j.logger.org.springframework.webflow=DEBUG, stdout, fileout | |
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | |
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | |
log4j.appender.stdout.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n | |
log4j.appender.fileout=org.apache.log4j.RollingFileAppender | |
log4j.appender.fileout.File=${jasperserver.root}/WEB-INF/logs/jasperserver.log | |
log4j.appender.fileout.MaxFileSize=1024KB | |
log4j.appender.fileout.MaxBackupIndex=1 | |
log4j.appender.fileout.layout=org.apache.log4j.PatternLayout | |
log4j.appender.fileout.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n | |
log4j.appender.jasperanalysis=org.apache.log4j.RollingFileAppender | |
log4j.appender.jasperanalysis.File=${jasperserver.root}/WEB-INF/logs/jasperanalysis.log | |
log4j.appender.jasperanalysis.MaxFileSize=1024KB | |
log4j.appender.jasperanalysis.MaxBackupIndex=1 | |
log4j.appender.jasperanalysis.layout=org.apache.log4j.PatternLayout | |
log4j.appender.jasperanalysis.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1},%t:%L - %m%n | |
#log4j.logger.mondrian.mdx=DEBUG,jasperanalysis | |
#log4j.logger.mondrian.sql=DEBUG,jasperanalysis | |
#log4j.logger.jasperanalysis.drillthroughSQL=DEBUG,jasperanalysis | |
#log4j.logger.com.tonbeller.jpivot.xmla.XMLA_SOAP=debug | |
#log4j.logger.com.jaspersoft.jasperserver.war.xmla.XmlaHandlerImpl=debug | |
#log4j.logger.com.jaspersoft.jasperserver.war.xmla.XmlaServletImpl=debug | |
#log4j.logger.mondrian.xmla.XmlaServlet=debug | |
#log4j.logger.mondrian.xmla.impl.DefaultXmlaServlet=debug | |
#log4j.logger.mondrian.xmla.XmlaHandler=debug | |
#log4j.logger.com.tonbeller.jpivot.mondrian.MondrianDrillThrough=debug | |
#log4j.logger.com.tonbeller.jpivot.mondrian.MondrianModel=debug | |
#log4j.logger.com.jaspersoft.jasperserver.war.OlapPrint=debug | |
#log4j.logger.com.jaspersoft.jasperserver.war.PrintServlet=debug | |
#log4j.logger.com.jaspersoft.jasperserver.war.ChartComponent=debug | |
#log4j.logger.com.jaspersoft.jasperserver.war.MondrianDrillThroughTableModel=debug | |
#log4j.logger.com.tonbeller.jpivot.olap.query.ExpandAllExt=debug | |
#log4j.logger.com.tonbeller.wcf.controller.RequestFilter=debug | |
#log4j.logger.mondrian.i18n.LocalizingDynamicSchemaProcessor=debug | |
#log4j.logger.mondrian.rolap.sql.SqlQuery=debug | |
#log4j.logger.net.sf.jasperreports.engine.query.JRJdbcQueryExecuter=debug | This is among the most commonly used items. It's useful for debugging report queries. |
log4j.appender.fileout.File=${jasperserver-pro.root}/WEB-INF/logs/jasperserver.log | |
log4j.appender.jasperanalysis.File=${jasperserver-pro.root}/WEB-INF/logs/jasperanalysis.log | |
#log4j.logger.org.springframework.orm.hibernate3.HibernateCallback=debug | |
#log4j.logger.org.springframework.orm.hibernate3.HibernateTemplate=debug | |
#log4j.logger.org.springframework.orm.hibernate3.support.HibernateDaoSupport=debug | |
#log4j.logger.com.jaspersoft.jasperserver.api.metadata.common.service.impl .HibernateDaoImpl=debug |
|
#log4j.logger.com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate .HibernateRepositoryServiceImpl=debug |
This useful logger is not included in log4j.properties in JasperServer 3.7 by default. You have to add it manually. |
#log4j.logger.com.jaspersoft.ji.util.profiling.service.ProfilingServiceImpl=debug | |
#log4j.logger.org.quartz=debug | This useful logger is not included in log4j.properties in JasperServer 3.7 by default. You have to add it manually. |
#log4j.logger.com.jaspersoft.jasperserver.ws.axis2=debug | This useful logger is not included in log4j.properties in JasperServer 3.7 by default. You have to add it manually. |
#log4j.logger.com.jaspersoft.ji.util.profiling.service.ProfilingAspect=debug | |
#log4j.logger.com.jaspersoft.ji.util.profiling.service.ProfilingRecorder=debug | |
#log4j.logger.com.jaspersoft.ji.util.profiling.service.GlobalProfilingState=debug | |
log4j.logger.mondrian.olap.MondrianProperties=error | |
log4j.logger.net.sf.jasperreports.engine.xml=error | |
#log4j.logger.com.jaspersoft.ji.ja.i18n.I18NAspect=debug | |
#log4j.logger.com.jaspersoft.ji.adhoc=debug | |
#log4j.logger.com.jaspersoft.commons.datarator=debug | |
#log4j.logger.com.jaspersoft.commons.semantic.datasource.impl .SemanticLayerSecurityResolverImpl=debug |
|
#log4j.logger.com.jaspersoft.commons.semantic.dsimpl.JdbcTableDataSet=debug | |
#log4j.logger.com.jaspersoft.commons.util.JSControlledJdbcQueryExecuter=debug | |
#log4j.logger.com.jaspersoft.commons.semantic.dsimpl.JdbcBaseDataSet=debug | This useful logger is not included in log4j.properties in JasperServer 3.5 by default. You have to add it manually. |
#log4j.logger.com.jaspersoft.jasperserver.api.metadata.user.service.impl .ObjectPermissionServiceImpl=debug |
This useful logger is not included in log4j.properties in JasperServer 3.7 by default. You have to add it manually. |
log4j.appender.profile=com.jaspersoft.ji.util.profiling.service.ProfilingAppender | |
log4j.appender.profile.layout=org.apache.log4j.PatternLayout | |
log4j.appender.profile.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n | |
log4j.rootLogger=warn, stdout, fileout, profile |
The above loggers represent most of the loggers available in JasperReports Server.
Log in or register to post comments